feat: Add schema for messages
This commit is contained in:
parent
e1d149e02c
commit
fe14426f85
@ -1,9 +1,18 @@
|
|||||||
import { pgTable, uuid, text } from 'drizzle-orm/pg-core';
|
import { pgTable, uuid, text, timestamp } from 'drizzle-orm/pg-core';
|
||||||
|
import { sql } from 'drizzle-orm';
|
||||||
|
|
||||||
export const users = pgTable('users', {
|
export const users = pgTable('users', {
|
||||||
id: uuid('id').primaryKey(),
|
id: uuid('id').primaryKey(),
|
||||||
username: text('username'),
|
username: text('username'),
|
||||||
displayname: text('display_name'),
|
displayName: text('display_name'),
|
||||||
salt: text('salt'),
|
salt: text('salt'),
|
||||||
hash: text('hash'),
|
hash: text('hash'),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const messages = pgTable('messages', {
|
||||||
|
id: uuid('id').primaryKey(),
|
||||||
|
user_id: uuid('user_id').references(() => users.id),
|
||||||
|
channel_id: uuid('channel_id'),
|
||||||
|
message: text('message'),
|
||||||
|
timestamp: timestamp('timestamp', { mode: 'date' }).default(sql`now()`),
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user