aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/migrations.go
blob: cec3c41c9d6e65b0123d765218ca4526bac4cd34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package database

import "database/sql"

// allMigrations is the list of migrations to perform to get an up to date database
// Order is important. Add new migrations at the end of the list.
var allMigrations = []func(tx *sql.Tx) error{
	func(tx *sql.Tx) (err error) {
		sql := `
			CREATE TABLE schema_version (
				version INTEGER NOT NULL
			);`
		_, err = tx.Exec(sql)
		return err
	},
}

// This variable exists so that tests can override it
var migrations = allMigrations