Skip to content

Instantly share code, notes, and snippets.

@marioarizaj
Last active January 18, 2021 12:38
Show Gist options
  • Save marioarizaj/5d98ba1f8257db82437d8389bc287f27 to your computer and use it in GitHub Desktop.
Save marioarizaj/5d98ba1f8257db82437d8389bc287f27 to your computer and use it in GitHub Desktop.
CREATE DATABASE serverless_example;
-- Replace 'test-password' with a secure password of your choice
CREATE USER srv_serverless WITH PASSWORD 'test-password';
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO srv_serverless;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO srv_serverless;
create table authors
(
id serial not null primary key ,
first_name text not null,
last_name text not null,
created_at timestamp default now() not null,
updated_at timestamp default now() not null
);
create table articles
(
id serial not null primary key ,
name text not null,
author_id int not null references authors,
created_at timestamp default now() not null,
updated_at timestamp default now() not null
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment