Skip to content

Commit

Permalink
Add example script for database tables, starting with db_version table
Browse files Browse the repository at this point in the history
for tracking the database version.
  • Loading branch information
mbjones committed Apr 6, 2018
1 parent c611014 commit 8079a7c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sql/00-metrics-tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Script for loading the core metrics tables in an empty database.
*/

/*
* db_version -- table to store the version history of this database
*/
CREATE SEQUENCE db_version_id_seq;
CREATE TABLE db_version (
db_version_id INT8 default nextval ('db_version_id_seq'), -- the identifier for the version
version VARCHAR(250), -- the version number
status INT8, -- status of the version, 1 if its the current version
CONSTRAINT db_version_pk PRIMARY KEY (db_version_id)
);
INSERT into db_version (version, status) VALUES ('0.0.1', 1);

0 comments on commit 8079a7c

Please sign in to comment.