mirror of
https://github.com/kou029w/hasura-rest-hands-on.git
synced 2025-01-18 08:05:12 +00:00
create migration file
This commit is contained in:
parent
32cffab604
commit
16f157c6a6
1 changed files with 16 additions and 0 deletions
16
db/migrations/default/1646649644573_init/up.sql
Normal file
16
db/migrations/default/1646649644573_init/up.sql
Normal file
|
@ -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);
|
Loading…
Add table
Reference in a new issue