Documentation
¶
Overview ¶
Package migrations holds taskmill's versioned schema migrations.
Each migration is a file named NNNN_name.sql. The placeholder __SCHEMA__ in a file stands for the schema name, which the caller validates. A file whose first line is "-- online" is an online step: see Migration.Online.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Migration ¶
type Migration struct {
Version int
Name string
SQL string
// Online marks an online step: statements that build or drop an index
// with CONCURRENTLY, which PostgreSQL runs only outside a transaction,
// one at a time, without blocking writes. Statements holds them, in
// order.
Online bool
Statements []Statement
// Blocking names the tables, schema-qualified, on which a migration
// that is not online builds an index that blocks writes while it reads
// the table: CREATE INDEX, or a unique or primary key constraint. Tables
// that the migration creates itself are left out: they are empty.
Blocking []string
}
Migration is one versioned schema change.