-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtable.sql
More file actions
42 lines (35 loc) · 1.03 KB
/
table.sql
File metadata and controls
42 lines (35 loc) · 1.03 KB
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
DROP INDEX account_activity_id_idx;
DROP INDEX account_activity_account_idx;
DROP INDEX account_activity_date_idx;
DROP INDEX account_activity_symbol_idx;
DROP TABLE account_activity;
CREATE TABLE account_activity (
id INTEGER PRIMARY KEY AUTOINCREMENT,
account NVARCHAR,
activity_date DATETIME NOT NULL,
symbol NVARCHAR NOT NULL,
security_description NOT NULL,
symbol_type NVARCHAR NOT NULL,
underlying_symbol NVARCHAR,
strike NUMERIC,
expiration DATE,
action NVARCHAR NOT NULL,
quantity NUMERIC,
price NUMERIC,
commission NUMERIC,
fees NUMERIC,
amount NUMERIC,
settlement_date DATETIME
);
CREATE UNIQUE INDEX IF NOT EXISTS account_activity_id_idx ON account_activity (
id
);
CREATE INDEX IF NOT EXISTS account_activity_account_idx ON account_activity (
account
);
CREATE INDEX IF NOT EXISTS account_activity_date_idx ON account_activity (
account, activity_date
);
CREATE INDEX IF NOT EXISTS account_activity_symbol_idx ON account_activity (
account, symbol
);