Add users and scheme sql

This commit is contained in:
DingZQ
2025-03-24 21:21:55 +08:00
parent 55bab8cf60
commit 189ad0bf8d
4 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
-- [USERS]
-- 王名豪
-- 2025/03/23
-- 存储系统的用户信息,如用户名,密码
create table users (
user_id SERIAL PRIMARY KEY,
username varchar(32) not null unique,
password varchar(32) not null
)

View File

@@ -0,0 +1,14 @@
-- [SCHEME_LIST]
-- 王名豪
-- 2025/03/23
-- 存储进行手动模拟后的方案列表
create table scheme_list (
scheme_id SERIAL PRIMARY KEY,
scheme_name varchar(32) not null,
scheme_type varchar(32) not null,
username varchar(32) not null REFERENCES "users"(username) ON UPDATE CASCADE ON DELETE RESTRICT,
create_time TIMESTAMP WITH TIME ZONE not null DEFAULT date_trunc('minute', CURRENT_TIMESTAMP),
scheme_start_time varchar(50) not null,
scheme_detail JSON
)

View File

@@ -0,0 +1,5 @@
-- 王名豪
-- 2025/03/23
-- 删除user这张表
drop table if exists users;

View File

@@ -0,0 +1,6 @@
-- [SCHEME_LIST]
-- 王名豪
-- 2025/03/23
-- 删除scheme_list这张表
drop table if exists scheme_list;