Documentation ¶
Index ¶
- Constants
- Variables
- type Column
- type MigrateCommand
- type MigrateCreator
- type MigrateFreshCommand
- type MigrateMakeCommand
- type MigrateRefreshCommand
- type MigrateResetCommand
- type MigrateRollbackCommand
- type MigrateStatusCommand
- type ModelMakeCommand
- type MysqlStubs
- type ObserverMakeCommand
- type PostgresqlStubs
- type SeedCommand
- func (receiver *SeedCommand) ConfirmToProceed(force bool) error
- func (receiver *SeedCommand) Description() string
- func (receiver *SeedCommand) Extend() command.Extend
- func (receiver *SeedCommand) GetSeeders(names []string) ([]seeder.Seeder, error)
- func (receiver *SeedCommand) Handle(ctx console.Context) error
- func (receiver *SeedCommand) Signature() string
- type SeederMakeCommand
- type SqliteStubs
- type SqlserverStubs
- type StructHelper
- type StructHelperInterface
- type Stubs
- type TableGuesser
Constants ¶
const ( IndexPrimary = "PRI" IndexUnique = "UNI" IndexNormal = "MUL" )
Variables ¶
var ChangePatterns = []string{
`_(to|from|in)_(\w+)_table$`,
`_(to|from|in)_(\w+)$`,
}
var CreatePatterns = []string{
`^create_(\w+)_table$`,
`^create_(\w+)$`,
}
var DefaultDb string
Functions ¶
This section is empty.
Types ¶
type Column ¶
type MigrateCommand ¶
type MigrateCommand struct {
// contains filtered or unexported fields
}
func NewMigrateCommand ¶
func NewMigrateCommand(config config.Config) *MigrateCommand
func (*MigrateCommand) Description ¶
func (receiver *MigrateCommand) Description() string
Description The console command description.
func (*MigrateCommand) Extend ¶
func (receiver *MigrateCommand) Extend() command.Extend
Extend The console command extend.
func (*MigrateCommand) Handle ¶
func (receiver *MigrateCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*MigrateCommand) Signature ¶
func (receiver *MigrateCommand) Signature() string
Signature The name and signature of the console command.
type MigrateCreator ¶
type MigrateCreator struct {
// contains filtered or unexported fields
}
func NewMigrateCreator ¶
func NewMigrateCreator(config config.Config) *MigrateCreator
type MigrateFreshCommand ¶
type MigrateFreshCommand struct {
// contains filtered or unexported fields
}
func NewMigrateFreshCommand ¶
func NewMigrateFreshCommand(config config.Config, artisan console.Artisan) *MigrateFreshCommand
func (*MigrateFreshCommand) Description ¶
func (receiver *MigrateFreshCommand) Description() string
Description The console command description.
func (*MigrateFreshCommand) Extend ¶
func (receiver *MigrateFreshCommand) Extend() command.Extend
Extend The console command extend.
func (*MigrateFreshCommand) Handle ¶
func (receiver *MigrateFreshCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*MigrateFreshCommand) Signature ¶
func (receiver *MigrateFreshCommand) Signature() string
Signature The name and signature of the console command.
type MigrateMakeCommand ¶
type MigrateMakeCommand struct {
// contains filtered or unexported fields
}
func NewMigrateMakeCommand ¶
func NewMigrateMakeCommand(config config.Config) *MigrateMakeCommand
func (*MigrateMakeCommand) Description ¶
func (receiver *MigrateMakeCommand) Description() string
Description The console command description.
func (*MigrateMakeCommand) Extend ¶
func (receiver *MigrateMakeCommand) Extend() command.Extend
Extend The console command extend.
func (*MigrateMakeCommand) Handle ¶
func (receiver *MigrateMakeCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*MigrateMakeCommand) Signature ¶
func (receiver *MigrateMakeCommand) Signature() string
Signature The name and signature of the console command.
type MigrateRefreshCommand ¶
type MigrateRefreshCommand struct {
// contains filtered or unexported fields
}
func NewMigrateRefreshCommand ¶
func NewMigrateRefreshCommand(config config.Config, artisan console.Artisan) *MigrateRefreshCommand
func (*MigrateRefreshCommand) Description ¶
func (receiver *MigrateRefreshCommand) Description() string
Description The console command description.
func (*MigrateRefreshCommand) Extend ¶
func (receiver *MigrateRefreshCommand) Extend() command.Extend
Extend The console command extend.
func (*MigrateRefreshCommand) Handle ¶
func (receiver *MigrateRefreshCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*MigrateRefreshCommand) Signature ¶
func (receiver *MigrateRefreshCommand) Signature() string
Signature The name and signature of the console command.
type MigrateResetCommand ¶
type MigrateResetCommand struct {
// contains filtered or unexported fields
}
func NewMigrateResetCommand ¶
func NewMigrateResetCommand(config config.Config) *MigrateResetCommand
func (*MigrateResetCommand) Description ¶
func (receiver *MigrateResetCommand) Description() string
Description The console command description.
func (*MigrateResetCommand) Extend ¶
func (receiver *MigrateResetCommand) Extend() command.Extend
Extend The console command extend.
func (*MigrateResetCommand) Handle ¶
func (receiver *MigrateResetCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*MigrateResetCommand) Signature ¶
func (receiver *MigrateResetCommand) Signature() string
Signature The name and signature of the console command.
type MigrateRollbackCommand ¶
type MigrateRollbackCommand struct {
// contains filtered or unexported fields
}
func NewMigrateRollbackCommand ¶
func NewMigrateRollbackCommand(config config.Config) *MigrateRollbackCommand
func (*MigrateRollbackCommand) Description ¶
func (receiver *MigrateRollbackCommand) Description() string
Description The console command description.
func (*MigrateRollbackCommand) Extend ¶
func (receiver *MigrateRollbackCommand) Extend() command.Extend
Extend The console command extend.
func (*MigrateRollbackCommand) Handle ¶
func (receiver *MigrateRollbackCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*MigrateRollbackCommand) Signature ¶
func (receiver *MigrateRollbackCommand) Signature() string
Signature The name and signature of the console command.
type MigrateStatusCommand ¶
type MigrateStatusCommand struct {
// contains filtered or unexported fields
}
func NewMigrateStatusCommand ¶
func NewMigrateStatusCommand(config config.Config) *MigrateStatusCommand
func (*MigrateStatusCommand) Description ¶
func (receiver *MigrateStatusCommand) Description() string
Description The console command description.
func (*MigrateStatusCommand) Extend ¶
func (receiver *MigrateStatusCommand) Extend() command.Extend
Extend The console command extend.
func (*MigrateStatusCommand) Handle ¶
func (receiver *MigrateStatusCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*MigrateStatusCommand) Signature ¶
func (receiver *MigrateStatusCommand) Signature() string
Signature The name and signature of the console command.
type ModelMakeCommand ¶
type ModelMakeCommand struct {
// contains filtered or unexported fields
}
func NewModelMakeCommand ¶
func NewModelMakeCommand(config config.Config) *ModelMakeCommand
func (*ModelMakeCommand) Description ¶
func (receiver *ModelMakeCommand) Description() string
Description The console command description.
func (*ModelMakeCommand) Extend ¶
func (receiver *ModelMakeCommand) Extend() command.Extend
Extend The console command extend.
func (*ModelMakeCommand) Handle ¶
func (receiver *ModelMakeCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*ModelMakeCommand) Signature ¶
func (receiver *ModelMakeCommand) Signature() string
Signature The name and signature of the console command.
type MysqlStubs ¶
type MysqlStubs struct { }
func (MysqlStubs) CreateDown ¶
func (receiver MysqlStubs) CreateDown() string
CreateDown Create down migration content.
func (MysqlStubs) CreateUp ¶
func (receiver MysqlStubs) CreateUp() string
CreateUp Create up migration content.
func (MysqlStubs) UpdateDown ¶
func (receiver MysqlStubs) UpdateDown() string
UpdateDown Update down migration content.
func (MysqlStubs) UpdateUp ¶
func (receiver MysqlStubs) UpdateUp() string
UpdateUp Update up migration content.
type ObserverMakeCommand ¶
type ObserverMakeCommand struct {
// contains filtered or unexported fields
}
func NewObserverMakeCommand ¶
func NewObserverMakeCommand(config config.Config) *ObserverMakeCommand
func (*ObserverMakeCommand) Description ¶
func (receiver *ObserverMakeCommand) Description() string
Description The console command description.
func (*ObserverMakeCommand) Extend ¶
func (receiver *ObserverMakeCommand) Extend() command.Extend
Extend The console command extend.
func (*ObserverMakeCommand) Handle ¶
func (receiver *ObserverMakeCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*ObserverMakeCommand) Signature ¶
func (receiver *ObserverMakeCommand) Signature() string
Signature The name and signature of the console command.
type PostgresqlStubs ¶
type PostgresqlStubs struct { }
func (PostgresqlStubs) CreateDown ¶
func (receiver PostgresqlStubs) CreateDown() string
CreateDown Create down migration content.
func (PostgresqlStubs) CreateUp ¶
func (receiver PostgresqlStubs) CreateUp() string
CreateUp Create up migration content.
func (PostgresqlStubs) UpdateDown ¶
func (receiver PostgresqlStubs) UpdateDown() string
UpdateDown Update down migration content.
func (PostgresqlStubs) UpdateUp ¶
func (receiver PostgresqlStubs) UpdateUp() string
UpdateUp Update up migration content.
type SeedCommand ¶
type SeedCommand struct {
// contains filtered or unexported fields
}
func NewSeedCommand ¶
func NewSeedCommand(config config.Config, seeder seeder.Facade) *SeedCommand
func (*SeedCommand) ConfirmToProceed ¶
func (receiver *SeedCommand) ConfirmToProceed(force bool) error
ConfirmToProceed determines if the command should proceed based on user confirmation.
func (*SeedCommand) Description ¶
func (receiver *SeedCommand) Description() string
Description The console command description.
func (*SeedCommand) Extend ¶
func (receiver *SeedCommand) Extend() command.Extend
Extend The console command extend.
func (*SeedCommand) GetSeeders ¶
func (receiver *SeedCommand) GetSeeders(names []string) ([]seeder.Seeder, error)
GetSeeders returns a seeder instances
func (*SeedCommand) Handle ¶
func (receiver *SeedCommand) Handle(ctx console.Context) error
Handle executes the console command.
func (*SeedCommand) Signature ¶
func (receiver *SeedCommand) Signature() string
Signature The name and signature of the console command.
type SeederMakeCommand ¶
type SeederMakeCommand struct {
// contains filtered or unexported fields
}
func NewSeederMakeCommand ¶
func NewSeederMakeCommand(config config.Config) *SeederMakeCommand
func (*SeederMakeCommand) Description ¶
func (receiver *SeederMakeCommand) Description() string
Description The console command description.
func (*SeederMakeCommand) Extend ¶
func (receiver *SeederMakeCommand) Extend() command.Extend
Extend The console command extend.
func (*SeederMakeCommand) Handle ¶
func (receiver *SeederMakeCommand) Handle(ctx console.Context) error
Handle Execute the console command.
func (*SeederMakeCommand) Signature ¶
func (receiver *SeederMakeCommand) Signature() string
Signature The name and signature of the console command.
type SqliteStubs ¶
type SqliteStubs struct { }
func (SqliteStubs) CreateDown ¶
func (receiver SqliteStubs) CreateDown() string
CreateDown Create down migration content.
func (SqliteStubs) CreateUp ¶
func (receiver SqliteStubs) CreateUp() string
CreateUp Create up migration content.
func (SqliteStubs) UpdateDown ¶
func (receiver SqliteStubs) UpdateDown() string
UpdateDown Update down migration content.
func (SqliteStubs) UpdateUp ¶
func (receiver SqliteStubs) UpdateUp() string
UpdateUp Update up migration content.
type SqlserverStubs ¶
type SqlserverStubs struct { }
func (SqlserverStubs) CreateDown ¶
func (receiver SqlserverStubs) CreateDown() string
CreateDown Create down migration content.
func (SqlserverStubs) CreateUp ¶
func (receiver SqlserverStubs) CreateUp() string
CreateUp Create up migration content.
func (SqlserverStubs) UpdateDown ¶
func (receiver SqlserverStubs) UpdateDown() string
UpdateDown Update down migration content.
func (SqlserverStubs) UpdateUp ¶
func (receiver SqlserverStubs) UpdateUp() string
UpdateUp Update up migration content.
type StructHelper ¶
type StructHelper struct { StructHelperInterface Db *gormio.DB DefaultDb string }
func NewStructHelper ¶
func NewStructHelper(conf config.Config) (helper *StructHelper, err error)
func (StructHelper) GetTableStruct ¶
func (s StructHelper) GetTableStruct(database, table string) []*Column
func (StructHelper) StringColumns ¶
func (s StructHelper) StringColumns(cols []*Column) string
type StructHelperInterface ¶
type StructHelperInterface interface { }
type TableGuesser ¶
type TableGuesser struct { }
Source Files ¶
- migrate.go
- migrate_command.go
- migrate_creator.go
- migrate_fresh_command.go
- migrate_make_command.go
- migrate_refresh_command.go
- migrate_reset_command.go
- migrate_rollback_command.go
- migrate_status_command.go
- migrate_stubs.go
- model_make_command.go
- observer_make_command.go
- seed_command.go
- seeder_make_command.go
- struct_helper.go
- stubs.go
- table_guesser.go