diff options
| author | yo momma <shutup@oops.wtf> | 2026-01-27 03:33:16 +0000 |
|---|---|---|
| committer | yo momma <shutup@oops.wtf> | 2026-01-27 03:33:16 +0000 |
| commit | fc9a4ea22eb91757b95cbe1bf1708be17fc2337a (patch) | |
| tree | 76a0122149e3288ee21d7fb6d0410b1b7b8970a4 /db/0-create.psql | |
| parent | 25b74138d68ade87689e714f10e1f3116da5bbee (diff) | |
- Replace hardcoded dump.fm URLs with host/scheme config\n- Add optional passwordless login flow\n- Update templates/static assets to avoid blocked HTTP resources\n- Ignore local uploads/SQL dumps
Diffstat (limited to 'db/0-create.psql')
| -rwxr-xr-x | db/0-create.psql | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/db/0-create.psql b/db/0-create.psql index 762bc3a..9a9b771 100755 --- a/db/0-create.psql +++ b/db/0-create.psql @@ -1,4 +1,8 @@ -CREATE DATABASE dumpfm; +-- dump.fm schema +-- +-- Run with: +-- createdb dumpfm +-- psql -d dumpfm -f db/0-create.psql CREATE TABLE users ( user_id SERIAL PRIMARY KEY, @@ -17,9 +21,8 @@ CREATE TABLE users ( profile_bg text ); -ALTER TABLE users ADD CONSTRAINT users_nick_constraint UNIQUE (LOWER(nick)); - -CREATE INDEX users_nick_lowercase_idx ON users (lower(nick)); +-- Case-insensitive uniqueness for nicks. +CREATE UNIQUE INDEX users_nick_lowercase_uidx ON users (lower(nick)); CREATE TABLE rooms ( room_id SERIAL PRIMARY KEY, @@ -147,7 +150,7 @@ CREATE TABLE direct_messages ( -- dont add this yet CREATE TABLE avatars ( avatar_id SERIAL PRIMARY KEY, - user_id NOT NULL REFERENCES users, + user_id integer NOT NULL REFERENCES users, created_on timestamp NOT NULL DEFAULT now(), type text, url text, @@ -160,6 +163,5 @@ CREATE TABLE avatars ( -- dont add this yet CREATE TABLE images ( - image_id SERIAL PRIMARY KEY, - + image_id SERIAL PRIMARY KEY ); |
