aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-05-28 20:36:00 +0100
committerChristopher Baines <mail@cbaines.net>2018-05-30 20:17:50 +0100
commit3b135d15e48eafb99395b3f1a62e15e5de1c5a4f (patch)
treee672864451e2f55216006ce90c8520f71cd31d7e /db
parent9df1bb790e24cad296d1187225dcb1fabed4b98b (diff)
downloadgovuk-mini-environment-admin-3b135d15e48eafb99395b3f1a62e15e5de1c5a4f.tar
govuk-mini-environment-admin-3b135d15e48eafb99395b3f1a62e15e5de1c5a4f.tar.gz
Add a new model to track services
Associated with a mini environment. This can also be used to store customisations over the chosen revision of govuk-guix.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180527183740_create_mini_environment_services.rb11
-rw-r--r--db/structure.sql66
2 files changed, 76 insertions, 1 deletions
diff --git a/db/migrate/20180527183740_create_mini_environment_services.rb b/db/migrate/20180527183740_create_mini_environment_services.rb
new file mode 100644
index 0000000..135889c
--- /dev/null
+++ b/db/migrate/20180527183740_create_mini_environment_services.rb
@@ -0,0 +1,11 @@
+class CreateMiniEnvironmentServices < ActiveRecord::Migration[5.1]
+ def change
+ create_table :mini_environment_services do |t|
+ t.string :name
+ t.string :revision
+ t.references :mini_environment, foreign_key: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index 12c19cf..cd71ee3 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -85,6 +85,39 @@ CREATE TABLE public.govuk_guix_revisions (
--
+-- Name: mini_environment_services; Type: TABLE; Schema: public; Owner: -
+--
+
+CREATE TABLE public.mini_environment_services (
+ id bigint NOT NULL,
+ name character varying,
+ revision character varying,
+ mini_environment_id bigint,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
+);
+
+
+--
+-- Name: mini_environment_services_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public.mini_environment_services_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: mini_environment_services_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public.mini_environment_services_id_seq OWNED BY public.mini_environment_services.id;
+
+
+--
-- Name: mini_environments; Type: TABLE; Schema: public; Owner: -
--
@@ -319,6 +352,13 @@ ALTER TABLE ONLY public.finished_terraform_jobs ALTER COLUMN id SET DEFAULT next
--
+-- Name: mini_environment_services id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.mini_environment_services ALTER COLUMN id SET DEFAULT nextval('public.mini_environment_services_id_seq'::regclass);
+
+
+--
-- Name: mini_environments id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -385,6 +425,14 @@ ALTER TABLE ONLY public.govuk_guix_revisions
--
+-- Name: mini_environment_services mini_environment_services_pkey; Type: CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.mini_environment_services
+ ADD CONSTRAINT mini_environment_services_pkey PRIMARY KEY (id);
+
+
+--
-- Name: mini_environments mini_environments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@@ -448,6 +496,13 @@ CREATE UNIQUE INDEX index_govuk_guix_revisions_on_commit_hash ON public.govuk_gu
--
+-- Name: index_mini_environment_services_on_mini_environment_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_mini_environment_services_on_mini_environment_id ON public.mini_environment_services USING btree (mini_environment_id);
+
+
+--
-- Name: index_mini_environments_on_backend_type_and_backend_id; Type: INDEX; Schema: public; Owner: -
--
@@ -470,6 +525,14 @@ ALTER TABLE ONLY public.mini_environments
--
+-- Name: mini_environment_services fk_rails_36052da616; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.mini_environment_services
+ ADD CONSTRAINT fk_rails_36052da616 FOREIGN KEY (mini_environment_id) REFERENCES public.mini_environments(id);
+
+
+--
-- PostgreSQL database dump complete
--
@@ -503,6 +566,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20180410192329'),
('20180410192412'),
('20180417195307'),
-('20180523062426');
+('20180523062426'),
+('20180527183740');