念のため他のテーブルの型も修正
This commit is contained in:
parent
8a88a1a31f
commit
111686c257
1 changed files with 2 additions and 2 deletions
|
@ -79,7 +79,7 @@ class DL():
|
|||
find_club_member_table = cursor.fetchall()
|
||||
print(find_club_member_table)
|
||||
if find_club_member_table[0][0] == False:
|
||||
cursor.execute("CREATE TABLE club_member (id SERIAL NOT NULL, name VARCHAR(50) NOT NULL, discord_username VARCHAR(50) NOT NULL, discord_userid VARCHAR(18) NOT NULL, PRIMARY KEY (id))")
|
||||
cursor.execute("CREATE TABLE club_member (id SERIAL NOT NULL, name VARCHAR(128) NOT NULL, discord_username VARCHAR(128) NOT NULL, discord_userid VARCHAR(18) NOT NULL, PRIMARY KEY (id))")
|
||||
self.db.commit()
|
||||
|
||||
cursor.execute("SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_schema = 'public' AND table_name = 'pc_list')")
|
||||
|
@ -96,7 +96,7 @@ class DL():
|
|||
find_pc_usage_history_table = cursor.fetchall()
|
||||
print(find_pc_usage_history_table)
|
||||
if find_pc_usage_history_table[0][0] == False:
|
||||
cursor.execute("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), bot_about VARCHAR(30), PRIMARY KEY (id), FOREIGN KEY (member_id) REFERENCES club_member(id), FOREIGN KEY (pc_number) REFERENCES pc_list(pc_number))")
|
||||
cursor.execute("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(128), bot_about VARCHAR(128), PRIMARY KEY (id), FOREIGN KEY (member_id) REFERENCES club_member(id), FOREIGN KEY (pc_number) REFERENCES pc_list(pc_number))")
|
||||
self.db.commit()
|
||||
|
||||
cursor.close()
|
||||
|
|
Loading…
Reference in a new issue