This commit is contained in:
BIN
db/1.sqlite
BIN
db/1.sqlite
Binary file not shown.
BIN
db/1.sqlite-shm
BIN
db/1.sqlite-shm
Binary file not shown.
BIN
db/1.sqlite-wal
BIN
db/1.sqlite-wal
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,51 +0,0 @@
|
||||
CREATE TABLE rooms (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
number TEXT NOT NULL UNIQUE,
|
||||
status TEXT NOT NULL DEFAULT 'clean'
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "conversation" (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,
|
||||
`creator_id` INTEGER,
|
||||
`title` TEXT,
|
||||
`created_at` TEXT DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "message" (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`conversation_id` INTEGER REFERENCES `conversation`(`id`),
|
||||
`sender_id` INTEGER NOT NULL, `content` TEXT NOT NULL,
|
||||
`sent_at` TEXT DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
CREATE TABLE "conversation_participants" (
|
||||
`conversation_id` INTEGER NOT NULL REFERENCES `conversation`(`id`),
|
||||
`user_id` INTEGER NOT NULL,
|
||||
`joined_at` TEXT DEFAULT (CURRENT_TIMESTAMP)
|
||||
PRIMARY KEY (conversation_id, user_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "inventory" (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`amount` INTEGER,
|
||||
`item_name` TEXT,
|
||||
`user_id` INT,
|
||||
`updated_at` TEXT DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "room_history" (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`room_id` INTEGER NOT NULL REFERENCES `rooms`(`id`),
|
||||
`room_number` TEXT NOT NULL,
|
||||
`status` TEXT,
|
||||
`updated_at` TEXT DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "inventory_history" (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL,
|
||||
`item_id` INTEGER NOT NULL REFERENCES `inventory`(`id`),
|
||||
`amount` INTEGER NOT NULL,
|
||||
`item_name` TEXT,
|
||||
`user_id` INT,
|
||||
`updated_at` TEXT DEFAULT (CURRENT_TIMESTAMP));
|
||||
|
||||
Reference in New Issue
Block a user