MCPcopy Create free account
hub / github.com/daodst/chat / AddMigrations

Method AddMigrations

internal/sqlutil/migrate.go:71–80  ·  view source on GitHub ↗

AddMigrations appends migrations to the list of migrations. Migrations are executed in the order they are added to the list. De-duplicates migrations using their Version field.

(migrations ...Migration)

Source from the content-addressed store, hash-verified

69// AddMigrations appends migrations to the list of migrations. Migrations are executed
70// in the order they are added to the list. De-duplicates migrations using their Version field.
71func (m *Migrator) AddMigrations(migrations ...Migration) {
72 m.mutex.Lock()
73 defer m.mutex.Unlock()
74 for _, mig := range migrations {
75 if _, ok := m.knownMigrations[mig.Version]; !ok {
76 m.migrations = append(m.migrations, mig)
77 m.knownMigrations[mig.Version] = struct{}{}
78 }
79 }
80}
81
82// Up executes all migrations in order they were added.
83func (m *Migrator) Up(ctx context.Context) error {

Callers 15

NewSqliteKeyChangesTableFunction · 0.95
OpenFunction · 0.95
CreateMembershipTableFunction · 0.95
CreateMembershipTableFunction · 0.95
Test_migrations_UpFunction · 0.95
NewPostgresReceiptsTableFunction · 0.95
NewPostgresEventsTableFunction · 0.95

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by 1

Test_migrations_UpFunction · 0.76