mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-12 04:55:39 +08:00
Provide down migrations.
This commit is contained in:
2
migrations/201606170001_devices_down.sql
Normal file
2
migrations/201606170001_devices_down.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
DROP INDEX serial_idx;
|
||||
DROP TABLE devices;
|
||||
@@ -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 '',
|
||||
|
||||
1
migrations/201606170002_workflows_down.sql
Normal file
1
migrations/201606170002_workflows_down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE workflows;
|
||||
@@ -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 <> '')
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
migrations/201606170003_profiles_down.sql
Normal file
1
migrations/201606170003_profiles_down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE profiles;
|
||||
@@ -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
|
||||
);
|
||||
|
||||
1
migrations/201606170004_workflow_profile_down.sql
Normal file
1
migrations/201606170004_workflow_profile_down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE workflow_profile;
|
||||
@@ -3,4 +3,3 @@ CREATE TABLE IF NOT EXISTS workflow_profile (
|
||||
profile_uuid uuid REFERENCES profiles,
|
||||
PRIMARY KEY (workflow_uuid, profile_uuid)
|
||||
);
|
||||
|
||||
|
||||
1
migrations/201606170005_workflow_workflow_down.sql
Normal file
1
migrations/201606170005_workflow_workflow_down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE workflow_workflow;
|
||||
@@ -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)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user