-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from vulcanize/version_table
singleton table for internally recording the database schema version
- Loading branch information
Showing
14 changed files
with
147 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- +goose Up | ||
CREATE TABLE IF NOT EXISTS public.db_version ( | ||
singleton BOOLEAN NOT NULL DEFAULT TRUE UNIQUE CHECK (singleton), | ||
version TEXT NOT NULL, | ||
tstamp TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW() | ||
); | ||
|
||
-- +goose Down | ||
DROP TABLE public.db_version; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- +goose Up | ||
INSERT INTO public.db_version (singleton, version) VALUES (true, 'v0.3.2') | ||
ON CONFLICT (singleton) DO UPDATE SET (version, tstamp) = ('v0.3.2', NOW()); | ||
|
||
-- +goose Down | ||
DELETE FROM public.db_version WHERE version = 'v0.3.2'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
db/pre_batch_processing_migrations/00014_create_eth_db_version_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- +goose Up | ||
CREATE TABLE IF NOT EXISTS public.db_version ( | ||
singleton BOOLEAN NOT NULL DEFAULT TRUE UNIQUE CHECK (singleton), | ||
version TEXT NOT NULL, | ||
tstamp TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW() | ||
); | ||
|
||
-- +goose Down | ||
DROP TABLE public.db_version; |
6 changes: 6 additions & 0 deletions
6
db/pre_batch_processing_migrations/00015_update_db_version.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- +goose Up | ||
INSERT INTO public.db_version (singleton, version) VALUES (true, 'v0.3.2') | ||
ON CONFLICT (singleton) DO UPDATE SET (version, tstamp) = ('v0.3.2', NOW()); | ||
|
||
-- +goose Down | ||
DELETE FROM public.db_version WHERE version = 'v0.3.2'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.