1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/mipilin synced 2025-05-10 23:33:07 +00:00

invite cooooddeesss

Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
Rae 5e 2024-12-10 22:27:43 -05:00
parent 7b563f5c31
commit 5abe0b5fad
Signed by: rae
GPG key ID: 5B1A0FAB9BAB81EE
22 changed files with 2326 additions and 16 deletions

View file

@ -29,7 +29,9 @@ export const updates = pgTable("updates", {
export const journalEntries = pgTable("journal_entries", {
id: integer().primaryKey().generatedAlwaysAsIdentity(),
user: integer().references(() => users.id, { onDelete: "cascade" }).notNull(),
user: integer()
.references(() => users.id, { onDelete: "cascade" })
.notNull(),
moodChange: integer("mood-change").default(0).notNull(),
entry: varchar({ length: 4096 }).default("").notNull(),
visibility: integer().default(1).notNull(),
@ -61,3 +63,11 @@ export const follows = pgTable(
};
}
);
export const inviteCodes = pgTable("invite_codes", {
token: varchar({ length: 22 }).primaryKey(),
user: integer("user_id").references(() => users.id, { onDelete: "cascade" }),
granted: timestamp().notNull(),
expires: timestamp().default(new Date(0)),
confersModerator: boolean("confers_moderator").default(false)
});