aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-05-30 20:17:02 +0100
committerChristopher Baines <mail@cbaines.net>2018-05-30 20:17:50 +0100
commit8b1ae33144bc4d496980ffc16cd304c8f107aff4 (patch)
tree198b02c2d5f649b319742f22c80cfa482f1e3d45 /db
parent31013afdfb53d849f8dabb86f92b467b1f016818 (diff)
downloadgovuk-mini-environment-admin-8b1ae33144bc4d496980ffc16cd304c8f107aff4.tar
govuk-mini-environment-admin-8b1ae33144bc4d496980ffc16cd304c8f107aff4.tar.gz
Add a new DataSnapshot model to store data snapshots
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180530191341_create_govuk_guix_data_snapshots.rb13
-rw-r--r--db/structure.sql58
2 files changed, 70 insertions, 1 deletions
diff --git a/db/migrate/20180530191341_create_govuk_guix_data_snapshots.rb b/db/migrate/20180530191341_create_govuk_guix_data_snapshots.rb
new file mode 100644
index 0000000..3327127
--- /dev/null
+++ b/db/migrate/20180530191341_create_govuk_guix_data_snapshots.rb
@@ -0,0 +1,13 @@
+class CreateGovukGuixDataSnapshots < ActiveRecord::Migration[5.1]
+ def change
+ create_table :govuk_guix_data_snapshots do |t|
+ t.string :store_path, null: false
+ t.boolean :archived, default: false, null: false
+ t.json :manifest, null: false
+
+ t.timestamps
+ end
+
+ add_index :govuk_guix_data_snapshots, :store_path, unique: true
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index cd71ee3..08cfe22 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -71,6 +71,39 @@ ALTER SEQUENCE public.finished_terraform_jobs_id_seq OWNED BY public.finished_te
--
+-- Name: govuk_guix_data_snapshots; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.govuk_guix_data_snapshots (
+ id bigint NOT NULL,
+ store_path character varying NOT NULL,
+ archived boolean DEFAULT false NOT NULL,
+ manifest json NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
+);
+
+
+--
+-- Name: govuk_guix_data_snapshots_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.govuk_guix_data_snapshots_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: govuk_guix_data_snapshots_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.govuk_guix_data_snapshots_id_seq OWNED BY public.govuk_guix_data_snapshots.id;
+
+
+--
-- Name: govuk_guix_revisions; Type: TABLE; Schema: public; Owner: -
--
@@ -352,6 +385,13 @@ ALTER TABLE ONLY public.finished_terraform_jobs ALTER COLUMN id SET DEFAULT next
--
+-- Name: govuk_guix_data_snapshots id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.govuk_guix_data_snapshots ALTER COLUMN id SET DEFAULT nextval('public.govuk_guix_data_snapshots_id_seq'::regclass);
+
+
+--
-- Name: mini_environment_services id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -417,6 +457,14 @@ ALTER TABLE ONLY public.finished_terraform_jobs
--
+-- Name: govuk_guix_data_snapshots govuk_guix_data_snapshots_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.govuk_guix_data_snapshots
+ ADD CONSTRAINT govuk_guix_data_snapshots_pkey PRIMARY KEY (id);
+
+
+--
-- Name: govuk_guix_revisions govuk_guix_revisions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@@ -489,6 +537,13 @@ ALTER TABLE ONLY public.users
--
+-- Name: index_govuk_guix_data_snapshots_on_store_path; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX index_govuk_guix_data_snapshots_on_store_path ON public.govuk_guix_data_snapshots USING btree (store_path);
+
+
+--
-- Name: index_govuk_guix_revisions_on_commit_hash; Type: INDEX; Schema: public; Owner: -
--
@@ -567,6 +622,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20180410192412'),
('20180417195307'),
('20180523062426'),
-('20180527183740');
+('20180527183740'),
+('20180530191341');