-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sql
More file actions
28 lines (23 loc) · 708 Bytes
/
Copy pathscript.sql
File metadata and controls
28 lines (23 loc) · 708 Bytes
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
DROP TABLE IF EXISTS tokens;
DROP TABLE IF EXISTS properties;
DROP TABLE IF EXISTS accounts;
CREATE TABLE IF NOT EXISTS accounts(
id serial PRIMARY KEY,
address char(42) UNIQUE NOT NULL
);
CREATE TABLE IF NOT EXISTS properties(
id serial PRIMARY KEY,
pausable boolean NOT NULL,
burnable boolean NOT NULL,
mintable boolean NOT NULL,
ownable boolean NOT NULL,
UNIQUE (pausable, burnable, mintable, ownable)
);
CREATE TABLE if NOT EXISTS tokens(
id serial PRIMARY KEY,
address char(42) NOT NULL UNIQUE,
deployer int NOT NULL,
properties int NOT NULL,
FOREIGN KEY(deployer) REFERENCES accounts(id),
FOREIGN KEY(properties) REFERENCES properties(id)
);