-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlWrite.sql
50 lines (43 loc) · 1.75 KB
/
sqlWrite.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
create database BONGU_ABI_DB default character set utf8 collate utf8_general_ci;
CREATE USER 'contract_manager'@'localhost' IDENTIFIED BY '1q2w3e4r';
GRANT ALL PRIVILEGES ON *.* TO 'contract_manager'@'localhost';
FLUSH PRIVILEGES;
CREATE TABLE contracts (
contracts_id INT NOT NULL AUTO_INCREMENT,
hashed_group_id VARCHAR(255) NOT NULL,
contract_address VARCHAR(100) NOT NULL,
contract_title VARCHAR(255) NOT NULL,
group_id_salt VARCHAR(255) NOT NULL,
created_at timestamp default current_timestamp,
updated_at timestamp default current_timestamp on update current_timestamp,
PRIMARY KEY(contracts_id)
);
CREATE TABLE votes (
votes_id INT NOT NULL AUTO_INCREMENT,
group_id INT NOT NULL,
user_id INT NOT NULL,
vote_count INT NOT NULL,
created_at timestamp default current_timestamp,
updated_at timestamp default current_timestamp on update current_timestamp,
PRIMARY KEY(votes_id)
);
CREATE TABLE dreaming_deposit (
dreaming_deposit_id INT NOT NULL AUTO_INCREMENT,
group_id INT NOT NULL,
revenue INT NOT NULL,
finance JSON NOT NULL,
created_at timestamp default current_timestamp,
updated_at timestamp default current_timestamp on update current_timestamp,
PRIMARY KEY(dreaming_deposit_id)
);
CREATE TABLE contract_log (
contracts_log_id INT NOT NULL AUTO_INCREMENT,
hashed_group_id VARCHAR(255) NOT NULL,
transaction_hash VARCHAR(255) NOT NULL,
created_at timestamp default current_timestamp,
PRIMARY KEY(contracts_log_id)
);
INSERT INTO user_auth_info (id, user_id, user_pw, nick_name)
VALUE(NULL, 'admin', 'admin', 'admin');
ALTER TABLE `contracts` DROP `contract_title`;
ALTER TABLE `contracts` DROP `group_id_salt`;