Use Postgres schema

This commit is contained in:
XANTRONIX Development 2025-01-07 10:10:14 -05:00
parent 06d18c5a57
commit a25c304e5b

View file

@ -1,8 +1,8 @@
begin transaction;
create table newsgroup (
id INTEGER PRIMARY KEY NOT NULL,
created_on DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
id SERIAL PRIMARY KEY,
created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_by TEXT NOT NULL,
name TEXT NOT NULL,
description TEXT NOT NULL,
@ -10,8 +10,8 @@ create table newsgroup (
);
create table message (
id INTEGER PRIMARY KEY NOT NULL,
created_on DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
id SERIAL PRIMARY KEY,
created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
message_id TEXT NOT NULL UNIQUE,
reference_ids TEXT,
sender TEXT NOT NULL,
@ -25,7 +25,7 @@ create index message_created_on_idx on message (
create table newsgroup_message (
newsgroup_id INTEGER NOT NULL,
message_id INTEGER NOT NULL,
message_id INTEGER NOT NULL,
FOREIGN KEY(newsgroup_id) REFERENCES newsgroup(id),
FOREIGN KEY(message_id) REFERENCES message(id)
@ -36,7 +36,7 @@ create unique index newsgroup_message_newsgroup_id_idx on newsgroup_message (
);
create table server_permission (
id INTEGER PRIMARY KEY NOT NULL,
id SERIAL PRIMARY KEY,
name TEXT NOT NULL
);
@ -46,7 +46,7 @@ insert into server_permission values
(3, 'ADMIN');
create table server_user (
id INTEGER PRIMARY KEY NOT NULL,
id SERIAL PRIMARY KEY,
active BOOLEAN NOT NULL DEFAULT TRUE,
username TEXT NOT NULL,
password TEXT,