Provide down migrations.

This commit is contained in:
Mosen
2016-06-17 23:30:48 +10:00
parent 678ef99ce2
commit 5896d8ca90
10 changed files with 9 additions and 11 deletions

View File

@@ -0,0 +1,2 @@
DROP INDEX serial_idx;
DROP TABLE devices;

View File

@@ -1,4 +1,5 @@
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE IF NOT EXISTS devices (
device_uuid uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
udid text NOT NULL DEFAULT '',

View File

@@ -0,0 +1 @@
DROP TABLE workflows;

View File

@@ -1,11 +1,5 @@
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE IF NOT EXISTS workflows (
workflow_uuid uuid PRIMARY KEY
DEFAULT uuid_generate_v4(),
workflow_uuid uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
name text UNIQUE NOT NULL CHECK (name <> '')
);

View File

@@ -0,0 +1 @@
DROP TABLE profiles;

View File

@@ -1,6 +1,5 @@
CREATE TABLE IF NOT EXISTS profiles (
profile_uuid uuid PRIMARY KEY
DEFAULT uuid_generate_v4(),
profile_uuid uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
payload_identifier text UNIQUE NOT NULL CHECK (payload_identifier <> ''),
profile_data bytea
);

View File

@@ -0,0 +1 @@
DROP TABLE workflow_profile;

View File

@@ -3,4 +3,3 @@ CREATE TABLE IF NOT EXISTS workflow_profile (
profile_uuid uuid REFERENCES profiles,
PRIMARY KEY (workflow_uuid, profile_uuid)
);

View File

@@ -0,0 +1 @@
DROP TABLE workflow_workflow;

View File

@@ -3,4 +3,3 @@ CREATE TABLE IF NOT EXISTS workflow_workflow (
included_workflow_uuid uuid REFERENCES workflows(workflow_uuid),
PRIMARY KEY (workflow_uuid, included_workflow_uuid)
);