all repos

onasty @ cd85e3b50d96a2e278d084738ebef6d20f35eea3

a one-time notes service
10 files changed, 37 insertions(+), 37 deletions(-)
run pg_format on all sql files (#45)

Author: Smirnov Oleksandr ss2316544@gmail.com
Committed by: GitHub noreply@github.com
Committed at: 2024-11-20 18:54:31 +0200
Parent: 688ee30
M migrations/20240613092407_users.down.sql

@@ -1,1 +1,1 @@

-drop table if exists users; +DROP TABLE IF EXISTS users;
M migrations/20240613092407_users.up.sql

@@ -1,9 +1,9 @@

-create table users ( - id uuid primary key default uuid_generate_v4(), - username varchar(255) not null unique, - email varchar(255) not null unique, - password varchar(255) not null, - activated boolean not null default false, - created_at timestamptz not null default now(), - last_login_at timestamptz not null default now() +CREATE TABLE users ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + username varchar(255) NOT NULL UNIQUE, + email varchar(255) NOT NULL UNIQUE, + password varchar(255) NOT NULL, + activated boolean NOT NULL DEFAULT FALSE, + created_at timestamptz NOT NULL DEFAULT now(), + last_login_at timestamptz NOT NULL DEFAULT now() );
M migrations/20240613092532_sessions.down.sql

@@ -1,1 +1,1 @@

-drop table if exists sessions; +DROP TABLE IF EXISTS sessions;
M migrations/20240613092532_sessions.up.sql

@@ -1,6 +1,6 @@

-create table sessions ( - id uuid primary key default uuid_generate_v4(), - user_id uuid references users (id), - refresh_token varchar(255) not null unique, - expires_at timestamptz not null +CREATE TABLE sessions ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id uuid REFERENCES users (id), + refresh_token varchar(255) NOT NULL UNIQUE, + expires_at timestamptz NOT NULL );
M migrations/20240716235210_notes.down.sql

@@ -1,1 +1,1 @@

-drop table if exists notes; +DROP TABLE IF EXISTS notes;
M migrations/20240716235210_notes.up.sql

@@ -1,8 +1,8 @@

-create table notes ( - id uuid primary key default uuid_generate_v4(), - content text not null, - slug varchar(255) not null unique, - burn_before_expiration boolean default false, - created_at timestamptz not null default now(), - expires_at timestamptz +CREATE TABLE notes ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + content text NOT NULL, + slug varchar(255) NOT NULL UNIQUE, + burn_before_expiration boolean DEFAULT FALSE, + created_at timestamptz NOT NULL DEFAULT now(), + expires_at timestamptz );
M migrations/20240724122920_notes_authors.down.sql

@@ -1,1 +1,1 @@

-drop table notes_authors; +DROP TABLE notes_authors;
M migrations/20240724122920_notes_authors.up.sql

@@ -1,6 +1,6 @@

-create table notes_authors ( - id uuid primary key default uuid_generate_v4(), - note_id uuid references notes (id) on delete cascade, - user_id uuid references users (id) on delete cascade, - created_at timestamptz not null default now() +CREATE TABLE notes_authors ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + note_id uuid REFERENCES notes (id) ON DELETE CASCADE, + user_id uuid REFERENCES users (id) ON DELETE CASCADE, + created_at timestamptz NOT NULL DEFAULT now() );
M migrations/20240729115827_verification_tokens.down.sql

@@ -1,1 +1,1 @@

-drop table verification_tokens; +DROP TABLE verification_tokens;
M migrations/20240729115827_verification_tokens.up.sql

@@ -1,8 +1,8 @@

-create table verification_tokens ( - id uuid primary key default uuid_generate_v4(), - user_id uuid not null unique references users(id), - token varchar(255) not null unique, - created_at timestamptz not null default now(), - expires_at timestamptz not null, - used_at timestamptz default null +CREATE TABLE verification_tokens ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + user_id uuid NOT NULL UNIQUE REFERENCES users (id), + token varchar(255) NOT NULL UNIQUE, + created_at timestamptz NOT NULL DEFAULT now(), + expires_at timestamptz NOT NULL, + used_at timestamptz DEFAULT NULL );