aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-23 22:23:36 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-24 15:21:32 -0700
commitd1d770d58c57df9fb357338793b3a1f54b5d55c0 (patch)
treec0150da51c97c055df6b8e85a75d47c9ab5070db
parentaff11938989901327fdf0198d08f97b7105e7b3b (diff)
downloadfatcat-d1d770d58c57df9fb357338793b3a1f54b5d55c0.tar.gz
fatcat-d1d770d58c57df9fb357338793b3a1f54b5d55c0.zip
move dummy data into primary migration
I couldn't come up with a "safe" way to wipe these rows (without causing larger insert PK uniqueness errors)
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql62
-rw-r--r--rust/migrations/2018-05-16-033858_dummy_data/down.sql1
-rw-r--r--rust/migrations/2018-05-16-033858_dummy_data/up.sql58
3 files changed, 62 insertions, 59 deletions
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index 1394ebf4..05b20fee 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -203,3 +203,65 @@ CREATE TABLE file_release (
target_release_ident_id UUID REFERENCES creator_ident(id) NOT NULL,
PRIMARY KEY (file_rev, target_release_ident_id)
);
+
+---------------------------------------------------------------------------
+---------------------------------------------------------------------------
+---------------------------------------------------------------------------
+
+-- Fake data at the raw SQL level, for early development and testing
+
+BEGIN;
+
+INSERT INTO editor (username, is_admin) VALUES
+ ('admin', true),
+ ('claire', true),
+ ('doug', false);
+
+INSERT INTO editgroup (editor_id, description) VALUES
+ (1, 'first edit ever!'),
+ (1, 'another one!'),
+ (3, 'user edit'),
+ (2, 'uncommited edit'),
+ (1, 'journal edit'),
+ (1, 'another journal edit');
+
+INSERT INTO editor (username, is_admin, active_editgroup_id) VALUES
+ ('bnewbold', true, 4);
+
+INSERT INTO changelog (editgroup_id) VALUES
+ (1),
+ (2),
+ (3),
+ (4),
+ (5);
+
+INSERT INTO creator_rev (name, orcid) VALUES
+ ('Grace Hopper', null),
+ ('Emily Noethe', null),
+ ('Christine Moran', '0000-0003-2088-7465');
+
+INSERT INTO creator_ident (id, is_live, rev_id, redirect_id) VALUES
+ ('f1f046a3-45c9-4b99-adce-000000000001', true, 1, null),
+ ('f1f046a3-45c9-4b99-adce-000000000002', true, 2, null),
+ ('f1f046a3-45c9-4b99-adce-000000000003', true, 3, null),
+ ('f1f046a3-45c9-4b99-adce-000000000004', false, 2, null);
+
+INSERT INTO creator_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
+ ('f1f046a3-45c9-4b99-adce-000000000001', 1, null, 1),
+ ('f1f046a3-45c9-4b99-adce-000000000002', 2, null, 2),
+ ('f1f046a3-45c9-4b99-adce-000000000003', 3, null, 3),
+ ('f1f046a3-45c9-4b99-adce-000000000004', 2, null, 4);
+
+INSERT INTO container_rev (name, issn) VALUES
+ ('Journal of Trivial Results', '1234-5678'),
+ ('MySpace Blog', null);
+
+INSERT INTO container_ident (id, is_live, rev_id, redirect_id) VALUES
+ ('f1f046a3-45c9-4b99-cccc-000000000001', true, 1, null),
+ ('f1f046a3-45c9-4b99-cccc-000000000002', true, 2, null);
+
+INSERT INTO container_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
+ ('f1f046a3-45c9-4b99-cccc-000000000001', 1, null, 4),
+ ('f1f046a3-45c9-4b99-cccc-000000000002', 2, null, 5);
+
+COMMIT;
diff --git a/rust/migrations/2018-05-16-033858_dummy_data/down.sql b/rust/migrations/2018-05-16-033858_dummy_data/down.sql
deleted file mode 100644
index 291a97c5..00000000
--- a/rust/migrations/2018-05-16-033858_dummy_data/down.sql
+++ /dev/null
@@ -1 +0,0 @@
--- This file should undo anything in `up.sql` \ No newline at end of file
diff --git a/rust/migrations/2018-05-16-033858_dummy_data/up.sql b/rust/migrations/2018-05-16-033858_dummy_data/up.sql
deleted file mode 100644
index 4775aadf..00000000
--- a/rust/migrations/2018-05-16-033858_dummy_data/up.sql
+++ /dev/null
@@ -1,58 +0,0 @@
-
--- Fake data at the raw SQL level, for early development and testing
-
-BEGIN;
-
-INSERT INTO editor (username, is_admin) VALUES
- ('admin', true),
- ('claire', true),
- ('doug', false);
-
-INSERT INTO editgroup (editor_id, description) VALUES
- (1, 'first edit ever!'),
- (1, 'another one!'),
- (3, 'user edit'),
- (2, 'uncommited edit'),
- (1, 'journal edit'),
- (1, 'another journal edit');
-
-INSERT INTO editor (username, is_admin, active_editgroup_id) VALUES
- ('bnewbold', true, 4);
-
-INSERT INTO changelog (editgroup_id) VALUES
- (1),
- (2),
- (3),
- (4),
- (5);
-
-INSERT INTO creator_rev (name, orcid) VALUES
- ('Grace Hopper', null),
- ('Emily Noethe', null),
- ('Christine Moran', '0000-0003-2088-7465');
-
-INSERT INTO creator_ident (id, is_live, rev_id, redirect_id) VALUES
- ('f1f046a3-45c9-4b99-adce-000000000001', true, 1, null),
- ('f1f046a3-45c9-4b99-adce-000000000002', true, 2, null),
- ('f1f046a3-45c9-4b99-adce-000000000003', true, 3, null),
- ('f1f046a3-45c9-4b99-adce-000000000004', false, 2, null);
-
-INSERT INTO creator_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
- ('f1f046a3-45c9-4b99-adce-000000000001', 1, null, 1),
- ('f1f046a3-45c9-4b99-adce-000000000002', 2, null, 2),
- ('f1f046a3-45c9-4b99-adce-000000000003', 3, null, 3),
- ('f1f046a3-45c9-4b99-adce-000000000004', 2, null, 4);
-
-INSERT INTO container_rev (name, issn) VALUES
- ('Journal of Trivial Results', '1234-5678'),
- ('MySpace Blog', null);
-
-INSERT INTO container_ident (id, is_live, rev_id, redirect_id) VALUES
- ('f1f046a3-45c9-4b99-cccc-000000000001', true, 1, null),
- ('f1f046a3-45c9-4b99-cccc-000000000002', true, 2, null);
-
-INSERT INTO container_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
- ('f1f046a3-45c9-4b99-cccc-000000000001', 1, null, 4),
- ('f1f046a3-45c9-4b99-cccc-000000000002', 2, null, 5);
-
-COMMIT;