Initial commit after extraction

This commit is contained in:
Ryan McGrath 2018-07-20 15:42:02 -07:00
commit 80ba54e4ef
No known key found for this signature in database
GPG key ID: 811674B62B666830
43 changed files with 3865 additions and 0 deletions

View file

@ -0,0 +1 @@
drop table users;

View file

@ -0,0 +1,21 @@
CREATE OR REPLACE FUNCTION update_timestamp() RETURNS TRIGGER AS $$
BEGIN
NEW.updated = now();
RETURN NEW;
END;
$$ language 'plpgsql';
create table if not exists users (
id serial primary key,
name text,
email text not null unique,
password text not null,
avatar text,
is_verified bool not null default false,
has_verified_email bool not null default false,
created timestamp with time zone not null default now(),
updated timestamp with time zone not null default now()
);
CREATE TRIGGER user_updated BEFORE INSERT OR UPDATE ON users
FOR EACH ROW EXECUTE PROCEDURE update_timestamp();