You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/site/migrations/000-create-users.js

26 lines
687 B

exports.up = DB => {
DB.sql(`
create table if not exists users (
id serial primary key,
uid character varying(255) not null unique,
name character varying(255),
username character varying(255) not null,
avatar text,
github_token character varying(255),
created_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp with time zone
);
create unique index if not exists users_pkey ON users(id int4_ops);
create unique index if not exists users_uid_key ON users(uid text_ops);
`);
};
exports.down = DB => {
DB.sql(`
drop table if exists users cascade;
drop index if exists users_uid_key;
drop index if exists users_pkey;
`);
};