From 16f157c6a67ca6c94199f05a9c3d5b45db25510f Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Mon, 7 Mar 2022 19:41:30 +0900 Subject: [PATCH] create migration file --- db/migrations/default/1646649644573_init/up.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 db/migrations/default/1646649644573_init/up.sql diff --git a/db/migrations/default/1646649644573_init/up.sql b/db/migrations/default/1646649644573_init/up.sql new file mode 100644 index 0000000..d27e6ad --- /dev/null +++ b/db/migrations/default/1646649644573_init/up.sql @@ -0,0 +1,16 @@ +SET check_function_bodies = false; +CREATE TABLE public.pages ( + id integer NOT NULL, + content jsonb NOT NULL +); +CREATE SEQUENCE public.pages_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; +ALTER SEQUENCE public.pages_id_seq OWNED BY public.pages.id; +ALTER TABLE ONLY public.pages ALTER COLUMN id SET DEFAULT nextval('public.pages_id_seq'::regclass); +ALTER TABLE ONLY public.pages + ADD CONSTRAINT pages_pkey PRIMARY KEY (id);