Versions in this module Expand all Collapse all v1 v1.0.1 Aug 15, 2024 Changes in this version + const CreateTableHistoryModel + const DDL + const DML + const SchemaMigrationHistory + func RetryTimeout(timeout uint64) time.Duration + func SQLCollectorFilename() string + func SortedScripts(services map[string]*Module) []moduleScript + type Block struct + func AppendBlock(blocks []Block, node ast.Node, typ StmtType) []Block + func (b Block) Nodes() []ast.Node + func (b Block) Type() StmtType + type DSNParameters struct + Database string + Host string + ParseTime bool + Password string + Port int + Timeout time.Duration + Username string + func (c DSNParameters) Format(database bool) (dsn string) + type Equal struct + func FieldTypeEqual(l, r *types.FieldType) *Equal + func (e *Equal) Equal() bool + func (e *Equal) Reason() string + type HistoryModel struct + Checksum string + CreatedAt time.Time + Filename string + ID uint64 + InstalledBy string + InstalledOn string + LanguageType string + Reversed string + ServiceName string + UpdatedAt time.Time + func (m HistoryModel) CreateTable(db *gorm.DB) + func (m HistoryModel) TableName() string + type Migrator struct + LocalScripts *Scripts + func New(parameters Parameters) (mig *Migrator, err error) + func (mig *Migrator) ClearSandbox() + func (mig *Migrator) DB() *gorm.DB + func (mig *Migrator) Run() (err error) + func (mig *Migrator) SandBox() *gorm.DB + type Module struct + Name string + PythonRequirementsText []byte + Scripts []*Script + func (m *Module) BaselineEqualCloud(tx *gorm.DB) *Equal + func (m *Module) BaselineSchema() *Schema + func (m *Module) BaselineTableNames() []string + func (m *Module) Filenames() []string + func (m *Module) FilterFreshBaseline(db *gorm.DB) *Module + func (m *Module) GetScriptByFilename(filename string) (*Script, bool) + func (m *Module) Schema() *Schema + func (m *Module) Sort() + func (m *Module) TableNames() []string + type Parameters interface + DebugSQL func() bool + MySQLParameters func() *DSNParameters + RetryTimeout func() uint64 + SandboxParameters func() *DSNParameters + SkipMigrate func() bool + SkipMigrationLint func() bool + SkipPreMigrate func() bool + SkipSandbox func() bool + type SQLCollectorDir interface + SQLCollectorDir func() string + type Schema struct + TableDefinitions map[string]*TableDefinition + func NewSchema() *Schema + func (s *Schema) Enter(in ast.Node) (ast.Node, bool) + func (s *Schema) Equal(o *Schema) *Equal + func (s *Schema) EqualWith(db *gorm.DB) *Equal + func (s *Schema) Leave(in ast.Node) (ast.Node, bool) + type Script struct + Blocks []Block + Name string + Nodes []ast.StmtNode + Pending bool + Rawtext []byte + Record *HistoryModel + Reversing []string + Type ScriptType + Workdir string + func NewScript(workdir, pathFromRepoRoot string) (*Script, error) + func NewScriptFromData(workdir, pathFromRepoRoot string, data []byte) (s *Script, err error) + func (s *Script) Checksum() string + func (s *Script) DDLNodes() []ast.DDLNode + func (s *Script) DMLNodes() []ast.StmtNode + func (s *Script) GetData() []byte + func (s *Script) GetName() string + func (s *Script) IsBaseline() bool + func (s *Script) IsEmpty() bool + type ScriptType string + const ScriptTypePython + const ScriptTypeSQL + type Scripts struct + Dirname string + Patches *Module + Services map[string]*Module + ServicesNames []string + Workdir string + func NewScripts(parameters ScriptsParameters) (*Scripts, error) + func (s *Scripts) AlterPermissionLint() error + func (s *Scripts) FreshBaselineModules(db *gorm.DB) map[string]*Module + func (s *Scripts) Get(serviceName string) ([]*Script, bool) + func (s *Scripts) GetPatches() *Module + func (s *Scripts) GetScriptByFilename(filename string) (*Module, *Script, bool) + func (s *Scripts) IgnoreMarkPending() + func (s *Scripts) InstalledChangesLint(ctx *context.Context, db *gorm.DB) error + func (s *Scripts) Lint() error + func (s *Scripts) MarkPending(tx *gorm.DB) + func (s *Scripts) SameNameLint() error + type ScriptsParameters interface + LintConfig func() map[string]sqllint.Config + MigrationDir func() string + Modules func() []string + Workdir func() string + type StmtType string + type TableDefinition struct + CreateStmt *ast.CreateTableStmt + func NewTableDefinition(stmt *ast.CreateTableStmt) *TableDefinition + func (d *TableDefinition) Enter(in ast.Node) (ast.Node, bool) + func (d *TableDefinition) Equal(o *TableDefinition) *Equal + func (d *TableDefinition) Leave(in ast.Node) (ast.Node, bool)