11168: Prohibit down-migration to YAML-only codebase.
authorTom Clegg <tom@curoverse.com>
Wed, 1 Mar 2017 22:59:33 +0000 (17:59 -0500)
committerTom Clegg <tom@curoverse.com>
Wed, 1 Mar 2017 22:59:33 +0000 (17:59 -0500)
services/api/db/migrate/20170301225558_no_downgrade_after_json.rb [new file with mode: 0644]
services/api/db/structure.sql

diff --git a/services/api/db/migrate/20170301225558_no_downgrade_after_json.rb b/services/api/db/migrate/20170301225558_no_downgrade_after_json.rb
new file mode 100644 (file)
index 0000000..030085e
--- /dev/null
@@ -0,0 +1,9 @@
+class NoDowngradeAfterJson < ActiveRecord::Migration
+  def up
+  end
+
+  def down
+    raise ActiveRecord::IrreversibleMigration.
+      new("cannot downgrade: older versions cannot read JSON from DB tables")
+  end
+end
index 9e1f0c9c2911b9cef14f3167ed5513248b88d84a..87b657543b6c851232e96defd117fc1f6991c8a6 100644 (file)
@@ -28,71 +28,6 @@ SET default_tablespace = '';
 
 SET default_with_oids = false;
 
---
--- Name: groups; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE groups (
-    id integer NOT NULL,
-    uuid character varying(255),
-    owner_uuid character varying(255),
-    created_at timestamp without time zone NOT NULL,
-    modified_by_client_uuid character varying(255),
-    modified_by_user_uuid character varying(255),
-    modified_at timestamp without time zone,
-    name character varying(255) NOT NULL,
-    description character varying(524288),
-    updated_at timestamp without time zone NOT NULL,
-    group_class character varying(255)
-);
-
-
---
--- Name: links; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE links (
-    id integer NOT NULL,
-    uuid character varying(255),
-    owner_uuid character varying(255),
-    created_at timestamp without time zone NOT NULL,
-    modified_by_client_uuid character varying(255),
-    modified_by_user_uuid character varying(255),
-    modified_at timestamp without time zone,
-    tail_uuid character varying(255),
-    link_class character varying(255),
-    name character varying(255),
-    head_uuid character varying(255),
-    properties text,
-    updated_at timestamp without time zone NOT NULL
-);
-
-
---
--- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE TABLE users (
-    id integer NOT NULL,
-    uuid character varying(255),
-    owner_uuid character varying(255) NOT NULL,
-    created_at timestamp without time zone NOT NULL,
-    modified_by_client_uuid character varying(255),
-    modified_by_user_uuid character varying(255),
-    modified_at timestamp without time zone,
-    email character varying(255),
-    first_name character varying(255),
-    last_name character varying(255),
-    identity_url character varying(255),
-    is_admin boolean,
-    prefs text,
-    updated_at timestamp without time zone NOT NULL,
-    default_owner_uuid character varying(255),
-    is_active boolean DEFAULT false,
-    username character varying(255)
-);
-
-
 --
 -- Name: api_client_authorizations; Type: TABLE; Schema: public; Owner: -; Tablespace: 
 --
@@ -438,6 +373,25 @@ CREATE SEQUENCE containers_id_seq
 ALTER SEQUENCE containers_id_seq OWNED BY containers.id;
 
 
+--
+-- Name: groups; Type: TABLE; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE TABLE groups (
+    id integer NOT NULL,
+    uuid character varying(255),
+    owner_uuid character varying(255),
+    created_at timestamp without time zone NOT NULL,
+    modified_by_client_uuid character varying(255),
+    modified_by_user_uuid character varying(255),
+    modified_at timestamp without time zone,
+    name character varying(255) NOT NULL,
+    description character varying(524288),
+    updated_at timestamp without time zone NOT NULL,
+    group_class character varying(255)
+);
+
+
 --
 -- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
@@ -704,6 +658,27 @@ CREATE SEQUENCE keep_services_id_seq
 ALTER SEQUENCE keep_services_id_seq OWNED BY keep_services.id;
 
 
+--
+-- Name: links; Type: TABLE; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE TABLE links (
+    id integer NOT NULL,
+    uuid character varying(255),
+    owner_uuid character varying(255),
+    created_at timestamp without time zone NOT NULL,
+    modified_by_client_uuid character varying(255),
+    modified_by_user_uuid character varying(255),
+    modified_at timestamp without time zone,
+    tail_uuid character varying(255),
+    link_class character varying(255),
+    name character varying(255),
+    head_uuid character varying(255),
+    properties text,
+    updated_at timestamp without time zone NOT NULL
+);
+
+
 --
 -- Name: links_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
@@ -1009,6 +984,31 @@ CREATE SEQUENCE traits_id_seq
 ALTER SEQUENCE traits_id_seq OWNED BY traits.id;
 
 
+--
+-- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace: 
+--
+
+CREATE TABLE users (
+    id integer NOT NULL,
+    uuid character varying(255),
+    owner_uuid character varying(255) NOT NULL,
+    created_at timestamp without time zone NOT NULL,
+    modified_by_client_uuid character varying(255),
+    modified_by_user_uuid character varying(255),
+    modified_at timestamp without time zone,
+    email character varying(255),
+    first_name character varying(255),
+    last_name character varying(255),
+    identity_url character varying(255),
+    is_admin boolean,
+    prefs text,
+    updated_at timestamp without time zone NOT NULL,
+    default_owner_uuid character varying(255),
+    is_active boolean DEFAULT false,
+    username character varying(255)
+);
+
+
 --
 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
@@ -2742,4 +2742,6 @@ INSERT INTO schema_migrations (version) VALUES ('20170105160301');
 
 INSERT INTO schema_migrations (version) VALUES ('20170105160302');
 
-INSERT INTO schema_migrations (version) VALUES ('20170216170823');
\ No newline at end of file
+INSERT INTO schema_migrations (version) VALUES ('20170216170823');
+
+INSERT INTO schema_migrations (version) VALUES ('20170301225558');
\ No newline at end of file