2022-10-19 03:25:43 +04:00
|
|
|
-- SQLite3
|
|
|
|
CREATE TABLE IF NOT EXISTS `entry` (
|
|
|
|
`entry_id` INTEGER PRIMARY KEY NOT NULL,
|
2023-02-05 20:02:22 +04:00
|
|
|
`created` TEXT NOT NULL,
|
2022-10-19 03:25:43 +04:00
|
|
|
`name` TEXT NOT NULL,
|
|
|
|
`message` TEXT NOT NULL,
|
|
|
|
`website` TEXT NOT NULL,
|
|
|
|
`hide_website` INTEGER NOT NULL DEFAULT TRUE);
|
|
|
|
|
|
|
|
CREATE INDEX IF NOT EXISTS `entry_created_idx`
|
|
|
|
ON `entry` (`created`);
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS `reply` (
|
|
|
|
`entry_id` INTEGER PRIMARY KEY NOT NULL,
|
2023-02-05 20:02:22 +04:00
|
|
|
`created` TEXT NOT NULL,
|
|
|
|
`message` TEXT NOT NULL,
|
2022-10-19 03:25:43 +04:00
|
|
|
FOREIGN KEY (`entry_id`)
|
|
|
|
REFERENCES `entry` (`entry_id`)
|
|
|
|
ON DELETE CASCADE
|
|
|
|
ON UPDATE CASCADE );
|