File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,18 @@ const LOG_MIGRATION_STMT: &str = "INSERT INTO vss_db_upgrades VALUES($1);";
3939#[ cfg( test) ]
4040const GET_MIGRATION_LOG_STMT : & str = "SELECT upgrade_from FROM vss_db_upgrades;" ;
4141
42+ // APPEND-ONLY list of migration statements
43+ //
44+ // Each statement MUST be applied in-order, and only once per database.
45+ //
46+ // We make an exception for the vss_db table creation statement, as users of VSS could have initialized the table
47+ // themselves.
4248const MIGRATIONS : & [ & str ] = & [
4349 "CREATE TABLE vss_db_version (db_version INTEGER);" ,
4450 "INSERT INTO vss_db_version VALUES(1);" ,
51+ // A write-only log of all the migrations performed on this database, useful for debugging and testing
4552 "CREATE TABLE vss_db_upgrades (upgrade_from INTEGER);" ,
46- // We do not complain if the table already exists, as a previous version of VSS could have already created
47- // this table
53+ // We do not complain if the table already exists, as users of VSS could have already created this table
4854 "CREATE TABLE IF NOT EXISTS vss_db (
4955 user_token character varying(120) NOT NULL CHECK (user_token <> ''),
5056 store_id character varying(120) NOT NULL CHECK (store_id <> ''),
You can’t perform that action at this time.
0 commit comments