Last active
January 18, 2021 12:38
-
-
Save marioarizaj/5d98ba1f8257db82437d8389bc287f27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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