From 5affe27f07ddd9988a7e259e168aacee235419e7 Mon Sep 17 00:00:00 2001 From: ei-sugimoto Date: Mon, 17 Jun 2024 15:55:54 +0900 Subject: [PATCH] feat: add SyncSchema --- migrator.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migrator.go b/migrator.go index 3d2b032b..c4db8cd6 100644 --- a/migrator.go +++ b/migrator.go @@ -24,6 +24,11 @@ func (db *DB) AutoMigrate(dst ...interface{}) error { return db.Migrator().AutoMigrate(dst...) } +// SyncSchema is an alias for AutoMigrate +func (db *DB) SyncSchema(dst ...interface{}) error { + return db.AutoMigrate(dst...) +} + // ViewOption view option type ViewOption struct { Replace bool // If true, exec `CREATE`. If false, exec `CREATE OR REPLACE`