diff --git a/.TODO b/.TODO new file mode 100644 index 0000000..e2ff786 --- /dev/null +++ b/.TODO @@ -0,0 +1,4 @@ +[ ] An audit log +[ ] Invite code pruning +[ ] Make the journal work (i dont really remember what was left out though) +[ ] Write a 404 page diff --git a/README.md b/README.md index e9d90b8..5a5b1ae 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MiPilin +# mipilin This website lets you check on how your friends are doing, which is a very good and noble thing and something you should feel proud of yourself for even considering. Also you can let YOUR friends know how YOU'RE doing. I guess. -MiPilin **MiPilin** +mipilin **mipilin** diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 92a1493..0000000 --- a/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -- [ ] An audit log -- [ ] Actual invite code pruning -- [ ] Make the journal work (i dont really remember what was left out though) diff --git a/db/schema.ts b/db/schema.ts index cab6909..5cfb5b5 100644 --- a/db/schema.ts +++ b/db/schema.ts @@ -13,8 +13,7 @@ export const users = pgTable("users", { name: varchar({ length: 26 }).unique().notNull(), pass: varchar({ length: 255 }).notNull(), registered: timestamp().notNull(), - moderator: boolean().default(false).notNull(), - banned: boolean().default(false).notNull() //! Not actually functional, banned users can still login + status: integer().default(0).notNull() // 000 |> verified / banned / moderator }); export const updates = pgTable("updates", { @@ -69,5 +68,5 @@ export const inviteCodes = pgTable("invite_codes", { user: integer("user_id").references(() => users.id, { onDelete: "cascade" }), granted: timestamp().notNull(), expires: timestamp().default(new Date(0)), - confersModerator: boolean("confers_moderator").default(false) + confers: integer().default(0) }); diff --git a/drizzle/0000_aromatic_night_nurse.sql b/drizzle/0000_aromatic_night_nurse.sql deleted file mode 100644 index f47ce38..0000000 --- a/drizzle/0000_aromatic_night_nurse.sql +++ /dev/null @@ -1,34 +0,0 @@ -CREATE TABLE IF NOT EXISTS "updates" ( - "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "updates_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), - "user" integer NOT NULL, - "mood" integer DEFAULT 0, - "description" varchar(2048) -); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "users" ( - "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "users_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), - "name" varchar(26) NOT NULL, - "pass" varchar(255) NOT NULL, - "registered" timestamp NOT NULL, - "bio" varchar(2048) DEFAULT '', - "moderator" boolean DEFAULT false, - "banned" boolean DEFAULT false, - CONSTRAINT "users_name_unique" UNIQUE("name") -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "updates" ADD CONSTRAINT "updates_user_users_id_fk" FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; - -CREATE TABLE "session" ( - "sid" varchar NOT NULL COLLATE "default", - "sess" json NOT NULL, - "expire" timestamp(6) NOT NULL -) -WITH (OIDS=FALSE); - -ALTER TABLE "session" ADD CONSTRAINT "session_pkey" PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE; - -CREATE INDEX "IDX_session_expire" ON "session" ("expire"); diff --git a/drizzle/0000_hard_leader.sql b/drizzle/0000_hard_leader.sql new file mode 100644 index 0000000..82267d7 --- /dev/null +++ b/drizzle/0000_hard_leader.sql @@ -0,0 +1,95 @@ +CREATE TABLE IF NOT EXISTS "follows" ( + "user_id" integer, + "follower_id" integer, + CONSTRAINT "follows_user_id_follower_id_pk" PRIMARY KEY("user_id","follower_id") +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "invite_codes" ( + "token" varchar(22) PRIMARY KEY NOT NULL, + "user_id" integer, + "granted" timestamp NOT NULL, + "expires" timestamp DEFAULT '1970-01-01 00:00:00.000', + "confers" integer DEFAULT 0 +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "journal_entries" ( + "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "journal_entries_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), + "user" integer NOT NULL, + "mood-change" integer DEFAULT 0 NOT NULL, + "entry" varchar(4096) DEFAULT '' NOT NULL, + "visibility" integer DEFAULT 1 NOT NULL, + "date" timestamp NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "profiles" ( + "user" integer PRIMARY KEY NOT NULL, + "bio" varchar(1024) DEFAULT '' NOT NULL, + "website" varchar DEFAULT '' NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "updates" ( + "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "updates_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), + "user" integer NOT NULL, + "mood" integer DEFAULT 0 NOT NULL, + "description" varchar(512) DEFAULT '' NOT NULL, + "date" timestamp NOT NULL +); +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "users" ( + "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "users_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), + "email" varchar NOT NULL, + "name" varchar(26) NOT NULL, + "pass" varchar(255) NOT NULL, + "registered" timestamp NOT NULL, + "status" integer DEFAULT 0 NOT NULL, + CONSTRAINT "users_email_unique" UNIQUE("email"), + CONSTRAINT "users_name_unique" UNIQUE("name") +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "follows" ADD CONSTRAINT "follows_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "follows" ADD CONSTRAINT "follows_follower_id_users_id_fk" FOREIGN KEY ("follower_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "invite_codes" ADD CONSTRAINT "invite_codes_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "journal_entries" ADD CONSTRAINT "journal_entries_user_users_id_fk" FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "profiles" ADD CONSTRAINT "profiles_user_users_id_fk" FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "updates" ADD CONSTRAINT "updates_user_users_id_fk" FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; + +-- session +CREATE TABLE "session" ( + "sid" varchar NOT NULL COLLATE "default", + "sess" json NOT NULL, + "expire" timestamp(6) NOT NULL +) +WITH (OIDS=FALSE); + +ALTER TABLE "session" ADD CONSTRAINT "session_pkey" PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE; + +CREATE INDEX "IDX_session_expire" ON "session" ("expire"); diff --git a/drizzle/0001_famous_silver_surfer.sql b/drizzle/0001_famous_silver_surfer.sql deleted file mode 100644 index cdb2ad5..0000000 --- a/drizzle/0001_famous_silver_surfer.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS "profiles" ( - "user" integer PRIMARY KEY NOT NULL, - "bio" varchar(2048) DEFAULT '' -); ---> statement-breakpoint -ALTER TABLE "users" ADD COLUMN "email" varchar NOT NULL;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "profiles" ADD CONSTRAINT "profiles_user_users_id_fk" FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -ALTER TABLE "users" DROP COLUMN IF EXISTS "bio";--> statement-breakpoint -ALTER TABLE "users" ADD CONSTRAINT "users_email_unique" UNIQUE("email"); \ No newline at end of file diff --git a/drizzle/0002_amusing_ultimatum.sql b/drizzle/0002_amusing_ultimatum.sql deleted file mode 100644 index a17bcbb..0000000 --- a/drizzle/0002_amusing_ultimatum.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "profiles" ALTER COLUMN "bio" SET DATA TYPE varchar(1024);--> statement-breakpoint -ALTER TABLE "updates" ALTER COLUMN "description" SET DATA TYPE varchar(512); \ No newline at end of file diff --git a/drizzle/0003_secret_blacklash.sql b/drizzle/0003_secret_blacklash.sql deleted file mode 100644 index f482ba2..0000000 --- a/drizzle/0003_secret_blacklash.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE "profiles" ALTER COLUMN "bio" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "updates" ALTER COLUMN "mood" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "updates" ALTER COLUMN "description" SET DEFAULT '';--> statement-breakpoint -ALTER TABLE "updates" ALTER COLUMN "description" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "moderator" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "users" ALTER COLUMN "banned" SET NOT NULL; \ No newline at end of file diff --git a/drizzle/0004_freezing_warpath.sql b/drizzle/0004_freezing_warpath.sql deleted file mode 100644 index f40df4b..0000000 --- a/drizzle/0004_freezing_warpath.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "updates" ADD COLUMN "date" timestamp NOT NULL; \ No newline at end of file diff --git a/drizzle/0005_magical_swarm.sql b/drizzle/0005_magical_swarm.sql deleted file mode 100644 index d3ee7ca..0000000 --- a/drizzle/0005_magical_swarm.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE IF NOT EXISTS "follows" ( - "user_id" integer, - "follower_id" integer, - CONSTRAINT "follows_user_id_follower_id_pk" PRIMARY KEY("user_id","follower_id") -); ---> statement-breakpoint -ALTER TABLE "profiles" ADD COLUMN "website" varchar DEFAULT '' NOT NULL;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "follows" ADD CONSTRAINT "follows_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "follows" ADD CONSTRAINT "follows_follower_id_users_id_fk" FOREIGN KEY ("follower_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0006_lame_grey_gargoyle.sql b/drizzle/0006_lame_grey_gargoyle.sql deleted file mode 100644 index 1b594c9..0000000 --- a/drizzle/0006_lame_grey_gargoyle.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS "journal_entries" ( - "id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "journal_entries_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), - "user" integer NOT NULL, - "mood-change" integer DEFAULT 0 NOT NULL, - "entry" varchar(4096) DEFAULT '' NOT NULL, - "visibility" integer DEFAULT 1 NOT NULL, - "date" timestamp NOT NULL -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "journal_entries" ADD CONSTRAINT "journal_entries_user_users_id_fk" FOREIGN KEY ("user") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0007_silly_freak.sql b/drizzle/0007_silly_freak.sql deleted file mode 100644 index 29dfbff..0000000 --- a/drizzle/0007_silly_freak.sql +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE IF NOT EXISTS "invite_codes" ( - "token" varchar(8) PRIMARY KEY NOT NULL, - "user_id" integer, - "granted" timestamp NOT NULL, - "expires" timestamp DEFAULT '1970-01-01 00:00:00.000' -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "invite_codes" ADD CONSTRAINT "invite_codes_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/drizzle/0008_huge_pyro.sql b/drizzle/0008_huge_pyro.sql deleted file mode 100644 index 63dab1d..0000000 --- a/drizzle/0008_huge_pyro.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "invite_codes" ALTER COLUMN "token" SET DATA TYPE varchar(20);--> statement-breakpoint -ALTER TABLE "invite_codes" ADD COLUMN "confersAdmin" boolean DEFAULT false; \ No newline at end of file diff --git a/drizzle/0009_unusual_ozymandias.sql b/drizzle/0009_unusual_ozymandias.sql deleted file mode 100644 index 5514790..0000000 --- a/drizzle/0009_unusual_ozymandias.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "invite_codes" RENAME COLUMN "confersAdmin" TO "confers_admin"; \ No newline at end of file diff --git a/drizzle/0010_exotic_ted_forrester.sql b/drizzle/0010_exotic_ted_forrester.sql deleted file mode 100644 index 353a3a2..0000000 --- a/drizzle/0010_exotic_ted_forrester.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "invite_codes" RENAME COLUMN "confers_admin" TO "confers_moderator"; \ No newline at end of file diff --git a/drizzle/0011_loose_dreadnoughts.sql b/drizzle/0011_loose_dreadnoughts.sql deleted file mode 100644 index 203c450..0000000 --- a/drizzle/0011_loose_dreadnoughts.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "invite_codes" ALTER COLUMN "token" SET DATA TYPE varchar(22); \ No newline at end of file diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json index 4e9cc78..f5c980b 100644 --- a/drizzle/meta/0000_snapshot.json +++ b/drizzle/meta/0000_snapshot.json @@ -1,9 +1,252 @@ { - "id": "7a6c6c4b-2c0a-424e-bf1a-142ab30f959d", + "id": "05baee8f-73c9-4001-b69d-ba7c46dadf5c", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { + "public.follows": { + "name": "follows", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "follower_id": { + "name": "follower_id", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "follows_user_id_users_id_fk": { + "name": "follows_user_id_users_id_fk", + "tableFrom": "follows", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "follows_follower_id_users_id_fk": { + "name": "follows_follower_id_users_id_fk", + "tableFrom": "follows", + "tableTo": "users", + "columnsFrom": [ + "follower_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "follows_user_id_follower_id_pk": { + "name": "follows_user_id_follower_id_pk", + "columns": [ + "user_id", + "follower_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.invite_codes": { + "name": "invite_codes", + "schema": "", + "columns": { + "token": { + "name": "token", + "type": "varchar(22)", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "granted": { + "name": "granted", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "expires": { + "name": "expires", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "'1970-01-01 00:00:00.000'" + }, + "confers": { + "name": "confers", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "invite_codes_user_id_users_id_fk": { + "name": "invite_codes_user_id_users_id_fk", + "tableFrom": "invite_codes", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.journal_entries": { + "name": "journal_entries", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "journal_entries_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "user": { + "name": "user", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "mood-change": { + "name": "mood-change", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "entry": { + "name": "entry", + "type": "varchar(4096)", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "visibility": { + "name": "visibility", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "date": { + "name": "date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "journal_entries_user_users_id_fk": { + "name": "journal_entries_user_users_id_fk", + "tableFrom": "journal_entries", + "tableTo": "users", + "columnsFrom": [ + "user" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profiles": { + "name": "profiles", + "schema": "", + "columns": { + "user": { + "name": "user", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "bio": { + "name": "bio", + "type": "varchar(1024)", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "website": { + "name": "website", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": {}, + "foreignKeys": { + "profiles_user_users_id_fk": { + "name": "profiles_user_users_id_fk", + "tableFrom": "profiles", + "tableTo": "users", + "columnsFrom": [ + "user" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, "public.updates": { "name": "updates", "schema": "", @@ -35,14 +278,21 @@ "name": "mood", "type": "integer", "primaryKey": false, - "notNull": false, + "notNull": true, "default": 0 }, "description": { "name": "description", - "type": "varchar(2048)", + "type": "varchar(512)", "primaryKey": false, - "notNull": false + "notNull": true, + "default": "''" + }, + "date": { + "name": "date", + "type": "timestamp", + "primaryKey": false, + "notNull": true } }, "indexes": {}, @@ -88,6 +338,12 @@ "cycle": false } }, + "email": { + "name": "email", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, "name": { "name": "name", "type": "varchar(26)", @@ -106,32 +362,25 @@ "primaryKey": false, "notNull": true }, - "bio": { - "name": "bio", - "type": "varchar(2048)", + "status": { + "name": "status", + "type": "integer", "primaryKey": false, - "notNull": false, - "default": "''" - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false + "notNull": true, + "default": 0 } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": { + "users_email_unique": { + "name": "users_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + }, "users_name_unique": { "name": "users_name_unique", "nullsNotDistinct": false, diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json deleted file mode 100644 index 6934f46..0000000 --- a/drizzle/meta/0001_snapshot.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "id": "e5a39ed0-96c3-43cf-9478-d038f2bc8bed", - "prevId": "7a6c6c4b-2c0a-424e-bf1a-142ab30f959d", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(2048)", - "primaryKey": false, - "notNull": false, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(2048)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0002_snapshot.json b/drizzle/meta/0002_snapshot.json deleted file mode 100644 index 023da4f..0000000 --- a/drizzle/meta/0002_snapshot.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "id": "330409e0-4bc1-408b-bc9d-58f0e35d5ab4", - "prevId": "e5a39ed0-96c3-43cf-9478-d038f2bc8bed", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": false, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": false, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0003_snapshot.json b/drizzle/meta/0003_snapshot.json deleted file mode 100644 index 72a586c..0000000 --- a/drizzle/meta/0003_snapshot.json +++ /dev/null @@ -1,206 +0,0 @@ -{ - "id": "76340b3d-907a-4a46-a13e-dff2c4bd98d4", - "prevId": "330409e0-4bc1-408b-bc9d-58f0e35d5ab4", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0004_snapshot.json b/drizzle/meta/0004_snapshot.json deleted file mode 100644 index 1e89794..0000000 --- a/drizzle/meta/0004_snapshot.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "id": "fded46bd-99e1-4cc3-9e18-e4d1f15c4bcb", - "prevId": "76340b3d-907a-4a46-a13e-dff2c4bd98d4", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0005_snapshot.json b/drizzle/meta/0005_snapshot.json deleted file mode 100644 index 1e08deb..0000000 --- a/drizzle/meta/0005_snapshot.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "id": "f8ae31ec-68e9-4857-93b2-abd7f834e580", - "prevId": "fded46bd-99e1-4cc3-9e18-e4d1f15c4bcb", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.follows": { - "name": "follows", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "follower_id": { - "name": "follower_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "follows_user_id_users_id_fk": { - "name": "follows_user_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "follows_follower_id_users_id_fk": { - "name": "follows_follower_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "follower_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "follows_user_id_follower_id_pk": { - "name": "follows_user_id_follower_id_pk", - "columns": [ - "user_id", - "follower_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "website": { - "name": "website", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0006_snapshot.json b/drizzle/meta/0006_snapshot.json deleted file mode 100644 index f775bae..0000000 --- a/drizzle/meta/0006_snapshot.json +++ /dev/null @@ -1,356 +0,0 @@ -{ - "id": "73a239ee-a945-48e0-a021-d415815a830b", - "prevId": "f8ae31ec-68e9-4857-93b2-abd7f834e580", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.follows": { - "name": "follows", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "follower_id": { - "name": "follower_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "follows_user_id_users_id_fk": { - "name": "follows_user_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "follows_follower_id_users_id_fk": { - "name": "follows_follower_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "follower_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "follows_user_id_follower_id_pk": { - "name": "follows_user_id_follower_id_pk", - "columns": [ - "user_id", - "follower_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.journal_entries": { - "name": "journal_entries", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "journal_entries_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood-change": { - "name": "mood-change", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "entry": { - "name": "entry", - "type": "varchar(4096)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "visibility": { - "name": "visibility", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "journal_entries_user_users_id_fk": { - "name": "journal_entries_user_users_id_fk", - "tableFrom": "journal_entries", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "website": { - "name": "website", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0007_snapshot.json b/drizzle/meta/0007_snapshot.json deleted file mode 100644 index 148389c..0000000 --- a/drizzle/meta/0007_snapshot.json +++ /dev/null @@ -1,408 +0,0 @@ -{ - "id": "f40891bb-8a67-4d29-8772-b05615e0aa9f", - "prevId": "73a239ee-a945-48e0-a021-d415815a830b", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.follows": { - "name": "follows", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "follower_id": { - "name": "follower_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "follows_user_id_users_id_fk": { - "name": "follows_user_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "follows_follower_id_users_id_fk": { - "name": "follows_follower_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "follower_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "follows_user_id_follower_id_pk": { - "name": "follows_user_id_follower_id_pk", - "columns": [ - "user_id", - "follower_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.invite_codes": { - "name": "invite_codes", - "schema": "", - "columns": { - "token": { - "name": "token", - "type": "varchar(8)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "granted": { - "name": "granted", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "'1970-01-01 00:00:00.000'" - } - }, - "indexes": {}, - "foreignKeys": { - "invite_codes_user_id_users_id_fk": { - "name": "invite_codes_user_id_users_id_fk", - "tableFrom": "invite_codes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.journal_entries": { - "name": "journal_entries", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "journal_entries_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood-change": { - "name": "mood-change", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "entry": { - "name": "entry", - "type": "varchar(4096)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "visibility": { - "name": "visibility", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "journal_entries_user_users_id_fk": { - "name": "journal_entries_user_users_id_fk", - "tableFrom": "journal_entries", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "website": { - "name": "website", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0008_snapshot.json b/drizzle/meta/0008_snapshot.json deleted file mode 100644 index ae0511b..0000000 --- a/drizzle/meta/0008_snapshot.json +++ /dev/null @@ -1,415 +0,0 @@ -{ - "id": "09a82ff0-6a18-4587-a33f-a55c2fef2ebf", - "prevId": "f40891bb-8a67-4d29-8772-b05615e0aa9f", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.follows": { - "name": "follows", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "follower_id": { - "name": "follower_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "follows_user_id_users_id_fk": { - "name": "follows_user_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "follows_follower_id_users_id_fk": { - "name": "follows_follower_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "follower_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "follows_user_id_follower_id_pk": { - "name": "follows_user_id_follower_id_pk", - "columns": [ - "user_id", - "follower_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.invite_codes": { - "name": "invite_codes", - "schema": "", - "columns": { - "token": { - "name": "token", - "type": "varchar(20)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "granted": { - "name": "granted", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "'1970-01-01 00:00:00.000'" - }, - "confersAdmin": { - "name": "confersAdmin", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "invite_codes_user_id_users_id_fk": { - "name": "invite_codes_user_id_users_id_fk", - "tableFrom": "invite_codes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.journal_entries": { - "name": "journal_entries", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "journal_entries_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood-change": { - "name": "mood-change", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "entry": { - "name": "entry", - "type": "varchar(4096)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "visibility": { - "name": "visibility", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "journal_entries_user_users_id_fk": { - "name": "journal_entries_user_users_id_fk", - "tableFrom": "journal_entries", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "website": { - "name": "website", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0009_snapshot.json b/drizzle/meta/0009_snapshot.json deleted file mode 100644 index 3cb2309..0000000 --- a/drizzle/meta/0009_snapshot.json +++ /dev/null @@ -1,415 +0,0 @@ -{ - "id": "49ea990a-0039-44d5-a35e-319db2299a46", - "prevId": "09a82ff0-6a18-4587-a33f-a55c2fef2ebf", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.follows": { - "name": "follows", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "follower_id": { - "name": "follower_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "follows_user_id_users_id_fk": { - "name": "follows_user_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "follows_follower_id_users_id_fk": { - "name": "follows_follower_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "follower_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "follows_user_id_follower_id_pk": { - "name": "follows_user_id_follower_id_pk", - "columns": [ - "user_id", - "follower_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.invite_codes": { - "name": "invite_codes", - "schema": "", - "columns": { - "token": { - "name": "token", - "type": "varchar(20)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "granted": { - "name": "granted", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "'1970-01-01 00:00:00.000'" - }, - "confers_admin": { - "name": "confers_admin", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "invite_codes_user_id_users_id_fk": { - "name": "invite_codes_user_id_users_id_fk", - "tableFrom": "invite_codes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.journal_entries": { - "name": "journal_entries", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "journal_entries_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood-change": { - "name": "mood-change", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "entry": { - "name": "entry", - "type": "varchar(4096)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "visibility": { - "name": "visibility", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "journal_entries_user_users_id_fk": { - "name": "journal_entries_user_users_id_fk", - "tableFrom": "journal_entries", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "website": { - "name": "website", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0010_snapshot.json b/drizzle/meta/0010_snapshot.json deleted file mode 100644 index 1663230..0000000 --- a/drizzle/meta/0010_snapshot.json +++ /dev/null @@ -1,415 +0,0 @@ -{ - "id": "61539639-4e1f-4bf2-854e-1657c5024c6c", - "prevId": "49ea990a-0039-44d5-a35e-319db2299a46", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.follows": { - "name": "follows", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "follower_id": { - "name": "follower_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "follows_user_id_users_id_fk": { - "name": "follows_user_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "follows_follower_id_users_id_fk": { - "name": "follows_follower_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "follower_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "follows_user_id_follower_id_pk": { - "name": "follows_user_id_follower_id_pk", - "columns": [ - "user_id", - "follower_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.invite_codes": { - "name": "invite_codes", - "schema": "", - "columns": { - "token": { - "name": "token", - "type": "varchar(20)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "granted": { - "name": "granted", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "'1970-01-01 00:00:00.000'" - }, - "confers_moderator": { - "name": "confers_moderator", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "invite_codes_user_id_users_id_fk": { - "name": "invite_codes_user_id_users_id_fk", - "tableFrom": "invite_codes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.journal_entries": { - "name": "journal_entries", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "journal_entries_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood-change": { - "name": "mood-change", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "entry": { - "name": "entry", - "type": "varchar(4096)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "visibility": { - "name": "visibility", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "journal_entries_user_users_id_fk": { - "name": "journal_entries_user_users_id_fk", - "tableFrom": "journal_entries", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "website": { - "name": "website", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/0011_snapshot.json b/drizzle/meta/0011_snapshot.json deleted file mode 100644 index 65dbc70..0000000 --- a/drizzle/meta/0011_snapshot.json +++ /dev/null @@ -1,415 +0,0 @@ -{ - "id": "d928a4c4-ab43-4979-b6aa-3892f29701c8", - "prevId": "61539639-4e1f-4bf2-854e-1657c5024c6c", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.follows": { - "name": "follows", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "follower_id": { - "name": "follower_id", - "type": "integer", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "follows_user_id_users_id_fk": { - "name": "follows_user_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "follows_follower_id_users_id_fk": { - "name": "follows_follower_id_users_id_fk", - "tableFrom": "follows", - "tableTo": "users", - "columnsFrom": [ - "follower_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "follows_user_id_follower_id_pk": { - "name": "follows_user_id_follower_id_pk", - "columns": [ - "user_id", - "follower_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.invite_codes": { - "name": "invite_codes", - "schema": "", - "columns": { - "token": { - "name": "token", - "type": "varchar(22)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "granted": { - "name": "granted", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "default": "'1970-01-01 00:00:00.000'" - }, - "confers_moderator": { - "name": "confers_moderator", - "type": "boolean", - "primaryKey": false, - "notNull": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "invite_codes_user_id_users_id_fk": { - "name": "invite_codes_user_id_users_id_fk", - "tableFrom": "invite_codes", - "tableTo": "users", - "columnsFrom": [ - "user_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.journal_entries": { - "name": "journal_entries", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "journal_entries_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood-change": { - "name": "mood-change", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "entry": { - "name": "entry", - "type": "varchar(4096)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "visibility": { - "name": "visibility", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "journal_entries_user_users_id_fk": { - "name": "journal_entries_user_users_id_fk", - "tableFrom": "journal_entries", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.profiles": { - "name": "profiles", - "schema": "", - "columns": { - "user": { - "name": "user", - "type": "integer", - "primaryKey": true, - "notNull": true - }, - "bio": { - "name": "bio", - "type": "varchar(1024)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "website": { - "name": "website", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "''" - } - }, - "indexes": {}, - "foreignKeys": { - "profiles_user_users_id_fk": { - "name": "profiles_user_users_id_fk", - "tableFrom": "profiles", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.updates": { - "name": "updates", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "updates_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "user": { - "name": "user", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "mood": { - "name": "mood", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "description": { - "name": "description", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "default": "''" - }, - "date": { - "name": "date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "updates_user_users_id_fk": { - "name": "updates_user_users_id_fk", - "tableFrom": "updates", - "tableTo": "users", - "columnsFrom": [ - "user" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "integer", - "primaryKey": true, - "notNull": true, - "identity": { - "type": "always", - "name": "users_id_seq", - "schema": "public", - "increment": "1", - "startWith": "1", - "minValue": "1", - "maxValue": "2147483647", - "cache": "1", - "cycle": false - } - }, - "email": { - "name": "email", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(26)", - "primaryKey": false, - "notNull": true - }, - "pass": { - "name": "pass", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "registered": { - "name": "registered", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "moderator": { - "name": "moderator", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "banned": { - "name": "banned", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_name_unique": { - "name": "users_name_unique", - "nullsNotDistinct": false, - "columns": [ - "name" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 75d0331..c4adb34 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -5,85 +5,8 @@ { "idx": 0, "version": "7", - "when": 1731272572767, - "tag": "0000_aromatic_night_nurse", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1731312604109, - "tag": "0001_famous_silver_surfer", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1731313744748, - "tag": "0002_amusing_ultimatum", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1731357649095, - "tag": "0003_secret_blacklash", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1731358040516, - "tag": "0004_freezing_warpath", - "breakpoints": true - }, - { - "idx": 5, - "version": "7", - "when": 1731393095652, - "tag": "0005_magical_swarm", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1731868543611, - "tag": "0006_lame_grey_gargoyle", - "breakpoints": true - }, - { - "idx": 7, - "version": "7", - "when": 1733871933739, - "tag": "0007_silly_freak", - "breakpoints": true - }, - { - "idx": 8, - "version": "7", - "when": 1733873221416, - "tag": "0008_huge_pyro", - "breakpoints": true - }, - { - "idx": 9, - "version": "7", - "when": 1733873440944, - "tag": "0009_unusual_ozymandias", - "breakpoints": true - }, - { - "idx": 10, - "version": "7", - "when": 1733874003964, - "tag": "0010_exotic_ted_forrester", - "breakpoints": true - }, - { - "idx": 11, - "version": "7", - "when": 1733874202840, - "tag": "0011_loose_dreadnoughts", + "when": 1733952034836, + "tag": "0000_hard_leader", "breakpoints": true } ] diff --git a/main.ts b/main.ts index 1579478..949c21a 100644 --- a/main.ts +++ b/main.ts @@ -20,7 +20,7 @@ import adminRoutes from "./routes/admin.js"; import loginRoutes from "./routes/login.js"; import userRoutes from "./routes/users.js"; import updateRoutes from "./routes/updates.js"; -import { createInviteCode, getMoods, render, setNonce } from "./routes/util.js"; +import { createInviteCode, getMoods, render, setNonce, UserStatus } from "./routes/util.js"; const db = drizzle(process.env.DATABASE_URL!); @@ -117,7 +117,7 @@ async function init(app: Express, db: NodePgDatabase) { const totalUsers = await db.select({ value: count() }).from(users); if (totalUsers[0].value === 0) { console.log("There are no users registered. Creating a temporary invite code right now."); - console.log(" " + await createInviteCode(db, 0, new Date(Date.now() + (1 * 1000 * 60)), true)); + console.log(" " + await createInviteCode(db, 0, new Date(Date.now() + (1 * 1000 * 60)), UserStatus.MODERATOR)); console.log("This code expires in 1 minute and will confer admin powers to whoever signs up with it."); } } diff --git a/reset.sh b/reset.sh new file mode 100755 index 0000000..8ac7d8d --- /dev/null +++ b/reset.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +sudo systemctl start docker +sudo docker container stop postgres +sudo docker container rm postgres +sudo docker run --name postgres -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 postgres +echo "Pausing for one second to give docker time to process what the fuck just happened" +sleep 1 +./node_modules/.bin/drizzle-kit migrate +echo +echo "Database reset and running" diff --git a/routes/admin.ts b/routes/admin.ts index 6737236..b1d9f79 100644 --- a/routes/admin.ts +++ b/routes/admin.ts @@ -1,13 +1,18 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { Express } from "express"; -import { createInviteCode, render } from "./util.js"; +import { createInviteCode, render, UserStatus } from "./util.js"; import { inviteCodes, users } from "../db/schema.js"; -import { desc, eq } from "drizzle-orm"; +import { and, count, desc, eq, sql } from "drizzle-orm"; import dayjs from "dayjs"; +const USER_REFERRAL_EXPIRATION = 7 * 24 * 60 * 60 * 1000 + export default function (app: Express, db: NodePgDatabase) { app.get("/mod", async (req, res) => { - if (!req.session["loggedIn"] || !req.session["moderator"]) { + if ( + !req.session["loggedIn"] || + !(req.session["status"] & UserStatus.MODERATOR) + ) { res.redirect("/"); return; } @@ -15,7 +20,11 @@ export default function (app: Express, db: NodePgDatabase) { const now = dayjs(); const codes = ( await db - .select({ expires: inviteCodes.expires, token: inviteCodes.token, uname: users.name }) + .select({ + expires: inviteCodes.expires, + token: inviteCodes.token, + uname: users.name + }) .from(inviteCodes) .leftJoin(users, eq(inviteCodes.user, users.id)) .orderBy(desc(inviteCodes.granted)) @@ -30,8 +39,11 @@ export default function (app: Express, db: NodePgDatabase) { render(db, "admin", "Admin Panel", res, req, { codes }); }); - app.post("/mod/codes/delete", async (req, res) => { - if (!req.session["loggedIn"] || !req.session["moderator"]) { + app.post("/codes/delete", async (req, res) => { + if ( + !req.session["loggedIn"] || + !(req.session["status"] & UserStatus.MODERATOR) + ) { res.redirect("/"); return; } @@ -39,10 +51,38 @@ export default function (app: Express, db: NodePgDatabase) { await db.delete(inviteCodes).where(eq(inviteCodes.token, req.body.token)); req.flash("success", "Deleted."); res.redirect("/mod"); - }) - app.post("/mod/codes/create", async (req, res) => { - if (!req.session["loggedIn"] || !req.session["moderator"]) { - res.redirect("/"); + }); + app.post("/codes/create", async (req, res) => { + if ( + !req.session["loggedIn"] + ) { + res.redirect("/login"); + return; + } + if (!(req.session["status"] & UserStatus.MODERATOR)) { + const { codesUsed } = ( + await db + .select({ codesUsed: count() }) + .from(inviteCodes) + .where( + and( + eq(inviteCodes.user, req.session["uid"]), + eq( + sql`extract(month from granted)`, + sql`extract(month from current_date)` + ) + ) + ) + )[0]; + if (codesUsed >= 5) { + req.flash("error", "You've generated the maximum of five codes this week. Your counter will reset next month."); + res.redirect("/dashboard"); + return; + } + + const code = await createInviteCode(db, req.session["uid"], new Date(Date.now() + USER_REFERRAL_EXPIRATION)); + req.flash("success", `Your code has been created as ${code}. It expires in a week so use it ASAP!!!`); + res.redirect("/dashboard"); return; } diff --git a/routes/login.ts b/routes/login.ts index 4cd9efa..0130c24 100644 --- a/routes/login.ts +++ b/routes/login.ts @@ -51,7 +51,7 @@ export default function(app: Express, db: NodePgDatabase) { } // invite code checking - const code = (await db.select({ expires: inviteCodes.expires, confersModerator: inviteCodes.confersModerator }).from(inviteCodes).where(eq(inviteCodes.token, req.body.referral)).limit(1))[0]; + const code = (await db.select({ expires: inviteCodes.expires, confers: inviteCodes.confers }).from(inviteCodes).where(eq(inviteCodes.token, req.body.referral)).limit(1))[0]; if (!code) { req.flash("error", "Invalid invite code! Make sure you pasted it in correctly WITH the hyphens."); res.redirect("/register"); @@ -94,7 +94,7 @@ export default function(app: Express, db: NodePgDatabase) { name: req.body.name, email: req.body.email, //! Not actually validating this like at all??? pass: hash, - moderator: code.confersModerator, + status: code.confers, registered: new Date(Date.now()) }) .returning({ uid: users.id }) @@ -102,7 +102,7 @@ export default function(app: Express, db: NodePgDatabase) { await db.insert(profiles).values({ user: uid }); req.session["loggedIn"] = true; - req.session["moderator"] = code.confersModerator; + req.session["status"] = code.confers; req.session["user"] = req.body.name; req.session["uid"] = uid; req.flash( @@ -138,7 +138,7 @@ export default function(app: Express, db: NodePgDatabase) { return; } req.session["loggedIn"] = true; - req.session["moderator"] = user.moderator; + req.session["status"] = user.status; req.session["user"] = user.name; req.session["uid"] = user.id; req.flash("success", "You're logged in! Welcome back!!"); diff --git a/routes/updates.ts b/routes/updates.ts index d1dbeb7..5fadc6c 100644 --- a/routes/updates.ts +++ b/routes/updates.ts @@ -2,12 +2,13 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { Express } from "express"; import { follows, + inviteCodes, journalEntries, profiles, updates, users } from "../db/schema.js"; -import { and, desc, eq } from "drizzle-orm"; +import { and, count, desc, eq, sql } from "drizzle-orm"; import dayjs from "dayjs"; import { getMoods, render } from "./util.js"; @@ -72,12 +73,39 @@ export default async function (app: Express, db: NodePgDatabase) { }; }); + // user invite codes + const codes = (await db + .select({ token: inviteCodes.token, expires: inviteCodes.expires }) + .from(inviteCodes) + .where(eq(inviteCodes.user, req.session["uid"]))).map((e) => { + return { + token: e.token, + expires: now.to(dayjs(e.expires || 0)) + } + }); + const { codesUsed } = ( + await db + .select({ codesUsed: count() }) + .from(inviteCodes) + .where( + and( + eq(inviteCodes.user, req.session["uid"]), + eq( + sql`extract(month from granted)`, + sql`extract(month from current_date)` + ) + ) + ) + )[0]; + render(db, "dashboard", "Dashboard", res, req, { user, moods, moodsSorted, moodHistory, recentUpdates, + codes, + codesUsed, feed: [] }); }); @@ -120,6 +148,26 @@ export default async function (app: Express, db: NodePgDatabase) { app.get("/journal", async (req, res) => { render(db, "journal", "Journal", res, req); }); + app.get("/journal/:id", async (req, res) => { + const entry = ( + await db + .select({ + uname: users.name, + content: journalEntries.entry, + date: journalEntries.date + }) + .from(journalEntries) + .where(eq(journalEntries.id, parseInt(req.params.id))) + .leftJoin(users, eq(journalEntries.user, users.id)) + )[0]; + if (!entry) { + //! TODO write a 404 page + res.statusCode = 404; + res.write("404 not found?? :("); + return; + } + render(db, "journal_view", "Journal Entry", res, req, { entry }); + }); app.post("/update/journal", async (req, res) => { if (!req.session["loggedIn"]) { res.redirect("/login"); @@ -141,21 +189,31 @@ export default async function (app: Express, db: NodePgDatabase) { let id: number; try { - // @ts-expect-error - const entry = await db.insert(journalEntries).values({ - user: req.session["uid"], - moodChange, - visibility, - entry: req.body.description, - date: new Date(Date.now()) - }).returning({ id: journalEntries.id }); + const entry = await db + .insert(journalEntries) + // @ts-expect-error + .values({ + user: req.session["uid"], + moodChange, + visibility, + entry: req.body.description, + date: new Date(Date.now()) + }) + .returning({ id: journalEntries.id }); id = entry[0].id; } catch (err) { - req.flash("error", "Failed to create your entry. Try again later or send these logs to roxwize so she can know what's up:

"+err); + req.flash( + "error", + "Failed to create your entry. Try again later or send these logs to roxwize so she can know what's up:

" + + err + ); res.redirect("/journal"); return; } - req.flash("success", `Your journal entry is now available as #${id}!`); + req.flash( + "success", + `Your journal entry is now available as #${id}!` + ); res.redirect("/journal"); }); } diff --git a/routes/users.ts b/routes/users.ts index ee1a8b6..b4c6125 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -2,7 +2,7 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres"; import { Express } from "express"; import { follows, profiles, updates, users } from "../db/schema.js"; import { and, desc, eq } from "drizzle-orm"; -import { getMoods, render } from "./util.js"; +import { getMoods, render, UserStatus } from "./util.js"; import { PgColumn } from "drizzle-orm/pg-core"; import dayjs from "dayjs"; @@ -88,13 +88,13 @@ export default async function (app: Express, db: NodePgDatabase) { res.redirect("/login"); return; } - const { uname, mod } = ( + const { uname } = ( await db - .select({ uname: users.name, mod: users.moderator }) + .select({ uname: users.name }) .from(users) .where(eq(users.name, req.params.user)) )[0]; - if ((uname || "") !== req.session["user"] && !mod) { + if ((uname || "") !== req.session["user"] && !(req.session["status"] & UserStatus.MODERATOR)) { res.redirect("back"); return; } diff --git a/routes/util.ts b/routes/util.ts index 33b7652..910d062 100644 --- a/routes/util.ts +++ b/routes/util.ts @@ -4,6 +4,12 @@ import { inviteCodes, updates } from "../db/schema.js"; import { count, desc, eq } from "drizzle-orm"; import fs from "node:fs/promises"; +export enum UserStatus { + MODERATOR = 0b001, + BANNED = 0b010, + TRUSTED = 0b100 +}; + const nonceChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_"; let nonce: string; @@ -64,7 +70,7 @@ export async function render( } const inviteCodeChars = "abcdefghijklmnopqrstuvwxyz0123456789" -export async function createInviteCode(db: NodePgDatabase, user: number, expires: Date, confersModerator = false) { +export async function createInviteCode(db: NodePgDatabase, user: number, expires: Date, confers = 0) { let existingToken = 1, token: string; while (existingToken) { token = user.toString().padStart(4, "0") + "-" @@ -84,7 +90,7 @@ export async function createInviteCode(db: NodePgDatabase, user: number, expires user: user || undefined, granted: new Date(Date.now()), expires, - confersModerator + confers }); return token; } diff --git a/static/moods.txt b/static/moods.txt index d7eac79..d1cc102 100644 --- a/static/moods.txt +++ b/static/moods.txt @@ -1 +1 @@ -abandoned;abnormal;abused;accepted;accomplished;achy;active;addicted;adored;adventurous;affectionate;aggravated;aggressive;agitated;alienated;alive;alluring;alone;aloof;alright;amazed;amazing;ambitious;ambivalent;amorous;amused;angelic;angry;angsty;annoyed;annoying;antisocial;antsy;anxious;apathetic;apologetic;appalled;appreciated;appreciative;apprehensive;argumentative;aroused;artistic;ashamed;asleep;astonished;astounded;athletic;attractive;audacious;awake;awesome;awestruck;awful;awkward;bad;baffled;balanced;bashful;beaming;beat;beautiful;befuddled;belittled;belligerent;bemused;betrayed;better;bewildered;bewitched;bipolar;bitchy;bitter;bittersweet;bizarre;blah;blank;blasphemous;bleak;bleh;blessed;blind;blissful;bloated;blonde;blotto;blue;boastful;boisterous;bold;bonkers;bootylicious;bored;bothered;bouncy;boyish;braindead;bratty;brave;breathless;bright;brilliant;broke;broken;broken-hearted;bruised;bubbly;bummed;burdened;burned;burned-out;businesslike;busy;buzzed;caffeinated;callous;calm;cantankerous;capricious;captivated;carefree;careless;catatonic;catty;cautious;cavalier;celebratory;challenged;changed;chaotic;charitable;charmed;charming;cheated;cheeky;cheerful;cheery;cheesy;cherished;childish;chilled;chillin;chipper;christmasy;classy;claustrophobic;clean;clever;clingy;clueless;clumsy;cocky;cold;colorful;comfortable;comforted;compassionate;competitive;complacent;complete;complicated;concerned;confident;confined;conflicted;confused;confuzzled;congested;connected;constipated;contemplative;content;controlled;cool;copacetic;corny;cosmic;courageous;coy;cozy;crabby;crafty;crampy;cranky;crappy;crazy;creative;creepy;crestfallen;cruel;crummy;crushed;crusty;cuddly;cunning;curious;cursed;cute;cynical;damned;dancy;dandy;dangerous;daring;dark;daunted;dazed;dead;decadent;decaffeinated;deceived;decent;deep;defeated;defensive;defiant;deficient;deflated;dejected;delicious;delighted;delirious;delusional;demented;demonic;demure;dense;depraved;depressed;deprived;deranged;deserted;desolate;desperate;despondent;destroyed;destructive;detached;determined;devastated;devilish;devious;devoted;different;dirty;disappointed;discarded;discombobulated;disconnected;discouraged;diseased;disenchanted;disengaged;disgruntled;disgusted;disillusioned;dismayed;disoriented;disrespected;dissociated;distant;distracted;distraught;distressed;disturbed;ditched;ditzy;divine;dizzy;dodgy;domestic;done;doomed;dorky;doubtful;dour;down;drained;dramatic;dreamy;driven;drowsy;drunk;dry;ducky;dull;dumb;dumbfounded;dysmorphic;dysphoric;eager;eccentric;ecstatic;edgy;eek!;effervescent;eh;elated;electric;electrified;embarrassed;emotional;emotionless;empathetic;empowered;empty;enamored;enchanted;encouraged;energetic;energized;engaged;enigmatic;enlightened;enraged;enraptured;entertained;enthralled;enthusiastic;envious;epic;erotic;esoteric;ethereal;euphoric;evil;exasperated;excellent;excited;excluded;exhausted;existential;exotic;expectant;experimental;explosive;exuberant;fabulous;faded;faithful;fake;famished;fancy;fantastic;fat;fatigued;fed up;feisty;feline;feral;festive;fetching;feverish;fickle;fidgety;fine;finite;fired up;fixated;flabbergasted;flashy;flattered;flighty;flippant;flirty;fluffy;flummoxed;flustered;focused;foggy;foolish;forgetful;forgiving;forgotten;forlorn;forsaken;fortuitous;found;foxy;fragile;frantic;frazzled;freaked;freaky;free;freezing;fresh;friendly;friendzoned;frightened;frisky;frozen;fruity;frumpy;frustrated;fulfilled;full;fun;funky;funny;furious;fuzzy;gay;geeked;geeky;gelatinous;generous;genki;ghetto;giddy;giggly;girly;glad;glamorous;gleeful;glittery;gloomy;glorious;glowing;glum;good;goofy;gorgeous;gothic;grand;grateful;great;greedy;groggy;groovy;gross;grouchy;grounded;grr;grumpy;guilty;hangry;hanukkahy;happy;hardcore;hated;hateful;haunted;headachy;healthy;heartbroken;heavenly;hella good;helpful;helpless;heroic;hesitant;high;hip;historical;hollow;holy;homesick;hopeful;hopeless;hormonal;horny;horrible;horrified;hostile;hot;hotheaded;humbled;humiliated;hungover;hungry;hurt;hyggelig;hyper;hyperactive;hypocritical;hysterical;icky;idiotic;ignorant;ignored;ill;illuminated;imaginative;immature;impatient;impish;important;impressed;in denial;in love;in pain;inadequate;incomplete;incredible;incredulous;indecisive;independent;indifferent;indulgent;industrious;infatuated;inferior;infinite;infuriated;innocent;inquisitive;insane;insatiable;insecure;insightful;insignificant;inspired;insulted;intellectual;intelligent;interested;intimidated;intoxicated;intrepid;intrigued;introspective;inventive;invincible;invisible;irate;irked;irreverent;irritable;irritated;isolated;itchy;jaded;jazzed;jealous;jetlagged;jiggy;jinxed;jittery;jocund;jolly;jovial;joyful;jubilant;jumbled;jumpy;kawaii;keen;kinky;klutzy;knackered;knowledgeable;kooky;lackadaisical;lame;lazy;leery;left out;lethargic;liberated;lifeless;listless;livid;lonely;longing;loopy;lost;loud;lousy;lovable;loved;lovely;lovesick;lovestruck;loving;loyal;lucky;lustful;mad;magical;malicious;manic;manipulative;manly;marvelous;masochistic;mature;mean;medicated;mediocre;megalomaniacal;meh;melancholy;mellow;melodramatic;mercurial;merry;messy;mid;miffed;misanthropic;mischievous;miserable;misplaced;misunderstood;mixed;moodless;moody;mopey;morbid;morose;mortified;motivated;mushy;musical;mysterious;mystic;mystified;naive;naked;narcissistic;nasty;natural;naughty;nauseous;needy;neglected;nerdy;nervous;neurotic;neutral;nice;nifty;nonchalant;normal;nostalgic;nothing;numb;nurturing;nutty;oblivious;obnoxious;obscene;obsessed;odd;offended;ok;old;olympic;optimistic;organized;orgasmic;ornery;outgoing;outraged;overheated;overjoyed;overloaded;overreactive;overstimulated;overwhelmed;overworked;oy;pained;pampered;panicked;paranoid;passionate;passive;pathetic;patient;patriotic;peaceful;peachy;peeved;pensive;peppy;perfect;perky;perplexed;perturbed;perverted;pessimistic;petrified;petty;philosophical;pi;pink;pissed;pissed off;pissy;placid;playful;pleasant;pleased;pmsy;poetic;pooped;popular;positive;pouty;powerful;powerless;precious;predatory;pregnant;preppy;pressured;pretty;productive;protective;proud;provocative;psyched;psychedelic;psychic;psycho;psychotic;pumped;punchy;punk;punky;pure;puzzled;queasy;queer;quiet;quirky;quixotic;rad;radiant;rambunctious;random;randy;raunchy;ready;rebellious;reborn;recalcitrant;reclusive;reflective;refreshed;regal;regretful;rejected;rejuvenated;relaxed;relieved;religious;reluctant;reminiscent;renewed;repulsed;resentful;reserved;resigned;resilient;resolute;resourceful;responsible;rested;restless;retro;rich;ridiculed;righteous;rofl;romantic;rowdy;royal;rude;rushed;sad;sadistic;safe;salty;sane;sapphic;sappy;sarcastic;sardonic;sassy;sated;satisfied;saturnine;saucy;scandalous;scared;scattered;schizophrenic;scholarly;scorned;screwed;secretive;secure;sedated;seductive;self-conscious;selfish;sensitive;sensual;sentimental;serene;serious;sexy;shady;shaken;shallow;shattered;sheepish;shifty;shiny;shocked;shy;sick;silly;sinful;single;sinister;skeptical;sketchy;slaphappy;sleazy;sleepless;sleepy;slinky;slothful;sluggish;slutty;sly;smart;smashing;smelly;smiley;smitten;smooth;smug;snarky;snazzy;sneaky;sneezy;sniffly;so-so;sober;social;somber;sophisticated;sore;sorrowful;sorry;sour;spacey;sparkly;spastic;spazzy;special;spectacular;speechless;spent;spicy;spiffy;spirited;spiritual;spiteful;splendid;split;spoiled;spontaneous;spooky;sporty;spunky;squishy;stabby;stable;starstruck;starving;stellar;sticky;stimulated;stoic;stoked;stoned;stormy;strange;stressed;strong;stubborn;stuck;studious;stuffed;stuffy;stumped;stunned;stunning;stupid;stylish;subdued;sublime;submissive;successful;sullen;sunny;super;superb;superior;supine;surly;surprised;surreal;suspicious;swamped;swanky;sweaty;sweet;swell;sympathetic;taciturn;talented;talkative;tearful;tenacious;tense;terrible;terrified;thankful;thirsty;thoughtful;thrilled;tickled;tickled pink;tipsy;tired;tormented;torn;tortured;touchy;toxic;tragic;tranquil;trapped;tricky;trippy;triumphant;troubled;twisted;twitchy;twitterpated;ugh;ugly;unappreciated;unattractive;uncertain;uncomfortable;undecided;understimulated;undesirable;uneasy;unfulfilled;ungrateful;ungrounded;unhappy;unhealthy;unimportant;uninspired;unique;unknown;unloved;unlucky;unmedicated;unmotivated;unpleasant;unproductive;unreal;unsafe;unsatisfied;unsettled;unstable;unsteady;unstoppable;unsure;unwanted;unworthy;upbeat;uplifted;upset;upside-down;used;useful;useless;vacant;vaccinated;vain;vamped;vengeful;vexed;vibrant;vicious;victorious;vindictive;violated;violent;virtuous;volatile;vulnerable;wacky;wanted;warm;wasted;weak;weary;weepy;weird;well;wet;whatever;whimsical;whiney;whiny;wicked;wild;wired;wise;wishful;wistful;witchy;withdrawn;witty;wonderful;woozy;worn;worried;worthless;wounded;wretched;wrong;xenophilic;young;yucky;yummy;zany;zapped;zealous;zen;zesty;zoned;zonked;afraid;fearful;on edge;subhuman;stagnant;mesmerized;erratic;uxorious;cybernetic;contagious;rough;tough;wrecked;otherworldly;loveless;disgusting;emo;defiled;mournful;autumnal;familial;unaccomplished;hyped;undervalued;ignited;locked in;sore;flamboyant;sigh;estranged;employed;bloody;oh my god;schlumped;revolutionary;spumoni;solemn;synthetic;ectoplasmic;inconsolable;ruined;bedraggled;procrastinatory;depleted;burdensome;undead;reanimated;validated;invalidated;cloudy;clouded;eepy;noticed;perceived;seen;interesting;adoring;conscious;willing \ No newline at end of file +abandoned;abnormal;abused;accepted;accomplished;achy;active;addicted;adored;adventurous;affectionate;aggravated;aggressive;agitated;alienated;alive;alluring;alone;aloof;alright;amazed;amazing;ambitious;ambivalent;amorous;amused;angelic;angry;angsty;annoyed;annoying;antisocial;antsy;anxious;apathetic;apologetic;appalled;appreciated;appreciative;apprehensive;argumentative;aroused;artistic;ashamed;asleep;astonished;astounded;athletic;attractive;audacious;awake;awesome;awestruck;awful;awkward;bad;baffled;balanced;bashful;beaming;beat;beautiful;befuddled;belittled;belligerent;bemused;betrayed;better;bewildered;bewitched;bipolar;bitchy;bitter;bittersweet;bizarre;blah;blank;blasphemous;bleak;bleh;blessed;blind;blissful;bloated;blonde;blotto;blue;boastful;boisterous;bold;bonkers;bootylicious;bored;bothered;bouncy;boyish;braindead;bratty;brave;breathless;bright;brilliant;broke;broken;broken-hearted;bruised;bubbly;bummed;burdened;burned;burned-out;businesslike;busy;buzzed;caffeinated;callous;calm;cantankerous;capricious;captivated;carefree;careless;catatonic;catty;cautious;cavalier;celebratory;challenged;changed;chaotic;charitable;charmed;charming;cheated;cheeky;cheerful;cheery;cheesy;cherished;childish;chilled;chillin;chipper;christmasy;classy;claustrophobic;clean;clever;clingy;clueless;clumsy;cocky;cold;colorful;comfortable;comforted;compassionate;competitive;complacent;complete;complicated;concerned;confident;confined;conflicted;confused;confuzzled;congested;connected;constipated;contemplative;content;controlled;cool;copacetic;corny;cosmic;courageous;coy;cozy;crabby;crafty;crampy;cranky;crappy;crazy;creative;creepy;crestfallen;cruel;crummy;crushed;crusty;cuddly;cunning;curious;cursed;cute;cynical;damned;dancy;dandy;dangerous;daring;dark;daunted;dazed;dead;decadent;decaffeinated;deceived;decent;deep;defeated;defensive;defiant;deficient;deflated;dejected;delicious;delighted;delirious;delusional;demented;demonic;demure;dense;depraved;depressed;deprived;deranged;deserted;desolate;desperate;despondent;destroyed;destructive;detached;determined;devastated;devilish;devious;devoted;different;dirty;disappointed;discarded;discombobulated;disconnected;discouraged;diseased;disenchanted;disengaged;disgruntled;disgusted;disillusioned;dismayed;disoriented;disrespected;dissociated;distant;distracted;distraught;distressed;disturbed;ditched;ditzy;divine;dizzy;dodgy;domestic;done;doomed;dorky;doubtful;dour;down;drained;dramatic;dreamy;driven;drowsy;drunk;dry;ducky;dull;dumb;dumbfounded;dysmorphic;dysphoric;eager;eccentric;ecstatic;edgy;eek!;effervescent;eh;elated;electric;electrified;embarrassed;emotional;emotionless;empathetic;empowered;empty;enamored;enchanted;encouraged;energetic;energized;engaged;enigmatic;enlightened;enraged;enraptured;entertained;enthralled;enthusiastic;envious;epic;erotic;esoteric;ethereal;euphoric;evil;exasperated;excellent;excited;excluded;exhausted;existential;exotic;expectant;experimental;explosive;exuberant;fabulous;faded;faithful;fake;famished;fancy;fantastic;fat;fatigued;fed up;feisty;feline;feral;festive;fetching;feverish;fickle;fidgety;fine;finite;fired up;fixated;flabbergasted;flashy;flattered;flighty;flippant;flirty;fluffy;flummoxed;flustered;focused;foggy;foolish;forgetful;forgiving;forgotten;forlorn;forsaken;fortuitous;found;foxy;fragile;frantic;frazzled;freaked;freaky;free;freezing;fresh;friendly;friendzoned;frightened;frisky;frozen;fruity;frumpy;frustrated;fulfilled;full;fun;funky;funny;furious;fuzzy;gay;geeked;geeky;gelatinous;generous;genki;ghetto;giddy;giggly;girly;glad;glamorous;gleeful;glittery;gloomy;glorious;glowing;glum;good;goofy;gorgeous;gothic;grand;grateful;great;greedy;groggy;groovy;gross;grouchy;grounded;grr;grumpy;guilty;hangry;hanukkahy;happy;hardcore;hated;hateful;haunted;headachy;healthy;heartbroken;heavenly;hella good;helpful;helpless;heroic;hesitant;high;hip;historical;hollow;holy;homesick;hopeful;hopeless;hormonal;horny;horrible;horrified;hostile;hot;hotheaded;humbled;humiliated;hungover;hungry;hurt;hyggelig;hyper;hyperactive;hypocritical;hysterical;icky;idiotic;ignorant;ignored;ill;illuminated;imaginative;immature;impatient;impish;important;impressed;in denial;in love;in pain;inadequate;incomplete;incredible;incredulous;indecisive;independent;indifferent;indulgent;industrious;infatuated;inferior;infinite;infuriated;innocent;inquisitive;insane;insatiable;insecure;insightful;insignificant;inspired;insulted;intellectual;intelligent;interested;intimidated;intoxicated;intrepid;intrigued;introspective;inventive;invincible;invisible;irate;irked;irreverent;irritable;irritated;isolated;itchy;jaded;jazzed;jealous;jetlagged;jiggy;jinxed;jittery;jocund;jolly;jovial;joyful;jubilant;jumbled;jumpy;kawaii;keen;kinky;klutzy;knackered;knowledgeable;kooky;lackadaisical;lame;lazy;leery;left out;lethargic;liberated;lifeless;listless;livid;lonely;longing;loopy;lost;loud;lousy;lovable;loved;lovely;lovesick;lovestruck;loving;loyal;lucky;lustful;mad;magical;malicious;manic;manipulative;manly;marvelous;masochistic;mature;mean;medicated;mediocre;megalomaniacal;meh;melancholy;mellow;melodramatic;mercurial;merry;messy;mid;miffed;misanthropic;mischievous;miserable;misplaced;misunderstood;mixed;moodless;moody;mopey;morbid;morose;mortified;motivated;mushy;musical;mysterious;mystic;mystified;naive;naked;narcissistic;nasty;natural;naughty;nauseous;needy;neglected;nerdy;nervous;neurotic;neutral;nice;nifty;nonchalant;normal;nostalgic;nothing;numb;nurturing;nutty;oblivious;obnoxious;obscene;obsessed;odd;offended;ok;old;olympic;optimistic;organized;orgasmic;ornery;outgoing;outraged;overheated;overjoyed;overloaded;overreactive;overstimulated;overwhelmed;overworked;oy;pained;pampered;panicked;paranoid;passionate;passive;pathetic;patient;patriotic;peaceful;peachy;peeved;pensive;peppy;perfect;perky;perplexed;perturbed;perverted;pessimistic;petrified;petty;philosophical;pi;pink;pissed;pissed off;pissy;placid;playful;pleasant;pleased;pmsy;poetic;pooped;popular;positive;pouty;powerful;powerless;precious;predatory;pregnant;preppy;pressured;pretty;productive;protective;proud;provocative;psyched;psychedelic;psychic;psycho;psychotic;pumped;punchy;punk;punky;pure;puzzled;queasy;queer;quiet;quirky;quixotic;rad;radiant;rambunctious;random;randy;raunchy;ready;rebellious;reborn;recalcitrant;reclusive;reflective;refreshed;regal;regretful;rejected;rejuvenated;relaxed;relieved;religious;reluctant;reminiscent;renewed;repulsed;resentful;reserved;resigned;resilient;resolute;resourceful;responsible;rested;restless;retro;rich;ridiculed;righteous;rofl;romantic;rowdy;royal;rude;rushed;sad;sadistic;safe;salty;sane;sapphic;sappy;sarcastic;sardonic;sassy;sated;satisfied;saturnine;saucy;scandalous;scared;scattered;schizophrenic;scholarly;scorned;screwed;secretive;secure;sedated;seductive;self-conscious;selfish;sensitive;sensual;sentimental;serene;serious;sexy;shady;shaken;shallow;shattered;sheepish;shifty;shiny;shocked;shy;sick;silly;sinful;single;sinister;skeptical;sketchy;slaphappy;sleazy;sleepless;sleepy;slinky;slothful;sluggish;slutty;sly;smart;smashing;smelly;smiley;smitten;smooth;smug;snarky;snazzy;sneaky;sneezy;sniffly;so-so;sober;social;somber;sophisticated;sore;sorrowful;sorry;sour;spacey;sparkly;spastic;spazzy;special;spectacular;speechless;spent;spicy;spiffy;spirited;spiritual;spiteful;splendid;split;spoiled;spontaneous;spooky;sporty;spunky;squishy;stabby;stable;starstruck;starving;stellar;sticky;stimulated;stoic;stoked;stoned;stormy;strange;stressed;strong;stubborn;stuck;studious;stuffed;stuffy;stumped;stunned;stunning;stupid;stylish;subdued;sublime;submissive;successful;sullen;sunny;super;superb;superior;supine;surly;surprised;surreal;suspicious;swamped;swanky;sweaty;sweet;swell;sympathetic;taciturn;talented;talkative;tearful;tenacious;tense;terrible;terrified;thankful;thirsty;thoughtful;thrilled;tickled;tickled pink;tipsy;tired;tormented;torn;tortured;touchy;toxic;tragic;tranquil;trapped;tricky;trippy;triumphant;troubled;twisted;twitchy;twitterpated;ugh;ugly;unappreciated;unattractive;uncertain;uncomfortable;undecided;understimulated;undesirable;uneasy;unfulfilled;ungrateful;ungrounded;unhappy;unhealthy;unimportant;uninspired;unique;unknown;unloved;unlucky;unmedicated;unmotivated;unpleasant;unproductive;unreal;unsafe;unsatisfied;unsettled;unstable;unsteady;unstoppable;unsure;unwanted;unworthy;upbeat;uplifted;upset;upside-down;used;useful;useless;vacant;vaccinated;vain;vamped;vengeful;vexed;vibrant;vicious;victorious;vindictive;violated;violent;virtuous;volatile;vulnerable;wacky;wanted;warm;wasted;weak;weary;weepy;weird;well;wet;whatever;whimsical;whiney;whiny;wicked;wild;wired;wise;wishful;wistful;witchy;withdrawn;witty;wonderful;woozy;worn;worried;worthless;wounded;wretched;wrong;xenophilic;young;yucky;yummy;zany;zapped;zealous;zen;zesty;zoned;zonked;afraid;fearful;on edge;subhuman;stagnant;mesmerized;erratic;uxorious;cybernetic;contagious;rough;tough;wrecked;otherworldly;loveless;disgusting;emo;defiled;mournful;autumnal;familial;unaccomplished;hyped;undervalued;ignited;locked in;sore;flamboyant;sigh;estranged;employed;bloody;oh my god;schlumped;revolutionary;spumoni;solemn;synthetic;ectoplasmic;inconsolable;ruined;bedraggled;procrastinatory;depleted;burdensome;undead;reanimated;validated;invalidated;cloudy;clouded;eepy;noticed;perceived;seen;interesting;adoring;conscious;willing;peckish;assured;rocky \ No newline at end of file diff --git a/views/admin.pug b/views/admin.pug index 815dfd6..36482e3 100644 --- a/views/admin.pug +++ b/views/admin.pug @@ -3,7 +3,7 @@ extends site.pug block content h1 Admin Panel h2 Invite codes - form(action="/mod/codes/delete", method="post") + form(action="/codes/delete", method="post") table tbody tr @@ -27,6 +27,6 @@ block content form(action="/mod/codes/prune", method="post") button(type="submit") Prune br - form(action="/mod/codes/create", method="post") + form(action="/codes/create", method="post") input(type="datetime-local", name="expiration") button(type="submit") Create diff --git a/views/dashboard.pug b/views/dashboard.pug index d05dd32..afd4c01 100644 --- a/views/dashboard.pug +++ b/views/dashboard.pug @@ -21,10 +21,10 @@ block page | #{mood.date} block content - if user.moderator - details(style="margin-bottom:1em;") - summary Moderation - p If you're seeing this, you are part of the exclusive club of moderators! You are now entitled to pizza for the rest of your life! And the ability to ban people and create new moods! For FREE! + p + a(href="#feed") Feed + | / + a(href="#invite-codes") Invite codes form#dashboard-update-form(action="/update/mood", method="post", onsubmit="disable(this);") select(name="mood", required) //- Maybe put the index of the mood in the value of the option element @@ -33,9 +33,32 @@ block content option= mood textarea(name="desc", placeholder="mood description (max 512 chars)", rows="5", maxlength="512") button(type="submit") Update - h1(style="margin-top:0.5em;") Feed + + h1#feed(style="margin-top:0.5em;") Feed include _feed.pug +feed(recentUpdates) + + h1#invite-codes(style="margin-top:1em;") Invite codes + p Invite your friends to the mipilin beta! You can create up to five invite codes every month, and they all expire within a week. + p + | Your current invite codes ( + strong= codesUsed + | /5): + if codes.length > 0 + table + tbody + tr + th Token + th Expires + for code of codes + tr + td= code.token + td= code.expires + else + .subtle You have no currently active invite codes. + br + form(action="/codes/create", method="post") + button(type="submit", disabled=codesUsed>=5) Generate script(nonce=nonce). function disable(form) { const btn = form.querySelector("button"); diff --git a/views/index.pug b/views/index.pug index 557623d..57b1133 100644 --- a/views/index.pug +++ b/views/index.pug @@ -6,9 +6,9 @@ block head block page #sidebar - h1 MiPilin + h1 mipilin p(style="margin-top:0;") - | Thx for being a part of the MiPilin beta! + | Thx for being a part of the mipilin beta! if session.loggedIn | | If you want to change your mood, update your profile, and see how your friends are doing, visit @@ -33,7 +33,7 @@ block page block content p - | Hi, this is MiPilin! It lets you tell your friends how you're feeling, as well as keep a journal of your current mood and their trends over time! Due respect goes to imood, from which I borrowed many ideas and basically all of the moods. + | Hi, this is mipilin! It lets you tell your friends how you're feeling, as well as keep a journal of your current mood and their trends over time! Due respect goes to imood, from which I borrowed many ideas and basically all of the moods. h1 Global Feed p Look at how all these people are doing!!! include _feed.pug diff --git a/views/journal_view.pug b/views/journal_view.pug new file mode 100644 index 0000000..e759ed9 --- /dev/null +++ b/views/journal_view.pug @@ -0,0 +1,13 @@ +extends site.pug + +block content + h1= entry.date.toLocaleDateString() + span + | by + | + a(href=`/users/${entry.uname}`)= entry.uname + | + | at #{entry.date.toLocaleTimeString()} + br + br + div= entry.content diff --git a/views/site.pug b/views/site.pug index a8859d3..46a2bf2 100644 --- a/views/site.pug +++ b/views/site.pug @@ -14,7 +14,7 @@ html(lang="en") img#header-logo(src="/img/logo.svg", alt="logo") nav if session.loggedIn - if session.moderator + if session.status & 0b001 a(href="/mod/") Admin a(href="/dashboard/") Dashboard a(href="/journal/") Journal