mirror of https://github.com/sveltejs/svelte
parent
5298f8ea35
commit
f672e6a721
@ -0,0 +1,24 @@
|
||||
exports.up = DB => {
|
||||
DB.sql(`
|
||||
create table if not exists gists (
|
||||
id serial primary key,
|
||||
uid uuid NOT NULL DEFAULT gen_random_uuid(),
|
||||
user_id integer REFERENCES users(id) not null,
|
||||
name character varying(255) not null,
|
||||
files json not null,
|
||||
created_at timestamp with time zone NOT NULL DEFAULT now(),
|
||||
updated_at timestamp with time zone
|
||||
);
|
||||
|
||||
create unique index if not exists gists_pkey ON gists(id int4_ops);
|
||||
create index if not exists gists_user_id_key ON gists(user_id int4_ops);
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = DB => {
|
||||
DB.sql(`
|
||||
drop table if exists gists cascade;
|
||||
drop index if exists gists_user_id_key;
|
||||
drop index if exists gists_pkey;
|
||||
`);
|
||||
};
|
Loading…
Reference in new issue