テーブルの名前、カラムなど修正

This commit is contained in:
suti7yk5032 2024-06-04 22:53:53 +09:00
parent e0e4ac73bb
commit dfcc4d7c37

View file

@ -1,13 +1,8 @@
# ログイン
psql -U suti7 -d dislocker
CREATE TABLE user
(user_id INTEGER PRIMARY KEY NOT NULL,
discord_id INTEGER NOT NULL,
discord_username VARCHAR(32) NOT NULL,
PRIMARY KEY (user_id));
CREATE TABLE club_member (id SERIAL NOT NULL, name VARCHAR(30) NOT NULL, discord_username VARCHAR(32) NOT NULL, discord_userid VARCHAR(18) NOT NULL, PRIMARY KEY (id));
CREATE TABLE pc_usage_history (id SERIAL NOT NULL, member_id INTEGER NOT NULL, pc_number INTEGER NOT NULL, device_number INTEGER NOT NULL, start_use_time TIMESTAMP NOT NULL, end_use_time TIMESTAMP, use_detail VARCHAR(30), PRIMARY KEY (id), FOREIGN KEY (memb
er_id) REFERENCES club_member(id));
CREATE TABLE user_list (user_id INTEGER NOT NULL, discord_username VARCHAR(32) NOT NULL, discord_userid INTEGER NOT NULL, PRIMARY KEY (user_id));
# テーブルを作る
CREATE TABLE web_auth (id SERIAL, username VARCHAR(10) NOT NULL, password VARCHAR(32) NOT NULL, PRIMARY KEY(id));
INSERTのとき文字列はシングルクォーテーションで囲む