Migrator migrator interface
| 66 | |
| 67 | // Migrator migrator interface |
| 68 | type Migrator interface { |
| 69 | // AutoMigrate |
| 70 | AutoMigrate(dst ...interface{}) error |
| 71 | |
| 72 | // Database |
| 73 | CurrentDatabase() string |
| 74 | FullDataTypeOf(*schema.Field) clause.Expr |
| 75 | GetTypeAliases(databaseTypeName string) []string |
| 76 | |
| 77 | // Tables |
| 78 | CreateTable(dst ...interface{}) error |
| 79 | DropTable(dst ...interface{}) error |
| 80 | HasTable(dst interface{}) bool |
| 81 | RenameTable(oldName, newName interface{}) error |
| 82 | GetTables() (tableList []string, err error) |
| 83 | TableType(dst interface{}) (TableType, error) |
| 84 | |
| 85 | // Columns |
| 86 | AddColumn(dst interface{}, field string) error |
| 87 | DropColumn(dst interface{}, field string) error |
| 88 | AlterColumn(dst interface{}, field string) error |
| 89 | MigrateColumn(dst interface{}, field *schema.Field, columnType ColumnType) error |
| 90 | // MigrateColumnUnique migrate column's UNIQUE constraint, it's part of MigrateColumn. |
| 91 | MigrateColumnUnique(dst interface{}, field *schema.Field, columnType ColumnType) error |
| 92 | HasColumn(dst interface{}, field string) bool |
| 93 | RenameColumn(dst interface{}, oldName, field string) error |
| 94 | ColumnTypes(dst interface{}) ([]ColumnType, error) |
| 95 | |
| 96 | // Views |
| 97 | CreateView(name string, option ViewOption) error |
| 98 | DropView(name string) error |
| 99 | |
| 100 | // Constraints |
| 101 | CreateConstraint(dst interface{}, name string) error |
| 102 | DropConstraint(dst interface{}, name string) error |
| 103 | HasConstraint(dst interface{}, name string) bool |
| 104 | |
| 105 | // Indexes |
| 106 | CreateIndex(dst interface{}, name string) error |
| 107 | DropIndex(dst interface{}, name string) error |
| 108 | HasIndex(dst interface{}, name string) bool |
| 109 | RenameIndex(dst interface{}, oldName, newName string) error |
| 110 | GetIndexes(dst interface{}) ([]Index, error) |
| 111 | } |
no outgoing calls
no test coverage detected