diff --git a/db/migrate/20230827154404_track_relationship_status.rb b/db/migrate/20230827154404_track_relationship_status.rb index 24cc2bf0..d4c93aea 100644 --- a/db/migrate/20230827154404_track_relationship_status.rb +++ b/db/migrate/20230827154404_track_relationship_status.rb @@ -18,7 +18,8 @@ def change end change_table(:relationships, bulk: true) do |t| - t.column(:status, :relationship_status, null: false) + # Will make this non-null in a future migration + t.column(:status, :relationship_status) end end end diff --git a/db/structure.sql b/db/structure.sql index a2cc8464..6e5f229e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -74,6 +74,17 @@ CREATE TYPE public.grade_type AS ENUM ( ); +-- +-- Name: relationship_status; Type: TYPE; Schema: public; Owner: - +-- + +CREATE TYPE public.relationship_status AS ENUM ( + 'planned', + 'subscribed', + 'enrolled' +); + + -- -- Name: review_status; Type: TYPE; Schema: public; Owner: - -- @@ -970,7 +981,8 @@ CREATE TABLE public.relationships ( section_id bigint NOT NULL, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, - notify boolean DEFAULT false NOT NULL + notify boolean DEFAULT false NOT NULL, + status public.relationship_status ); @@ -2517,6 +2529,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20230430161016'), ('20230511033013'), ('20230718192047'), -('20230820174337'); +('20230820174337'), +('20230827154404');