diff options
author | jloup <jeanloup.jamet@gmail.com> | 2018-05-01 10:16:53 +0200 |
---|---|---|
committer | Ismaƫl Bouya <ismael.bouya@normalesup.org> | 2018-05-01 10:22:51 +0200 |
commit | 17b685396a34cb1fef8439e1b6802c6b7f59fbe2 (patch) | |
tree | a29f2f25cac1afa9fd335654e3db8c4a65c78d74 /db/migrations.go | |
parent | 2b2fd737b4b6e530e67de743e58b630d69228c57 (diff) | |
download | Front-17b685396a34cb1fef8439e1b6802c6b7f59fbe2.tar.gz Front-17b685396a34cb1fef8439e1b6802c6b7f59fbe2.tar.zst Front-17b685396a34cb1fef8439e1b6802c6b7f59fbe2.zip |
Fix PG migrations + redis config.
Diffstat (limited to 'db/migrations.go')
-rw-r--r-- | db/migrations.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/db/migrations.go b/db/migrations.go index 286fe17..38ea8aa 100644 --- a/db/migrations.go +++ b/db/migrations.go | |||
@@ -26,22 +26,22 @@ var migrations []Migration = []Migration{ | |||
26 | config jsonb, | 26 | config jsonb, |
27 | UNIQUE(user_id, market_name) | 27 | UNIQUE(user_id, market_name) |
28 | )`, | 28 | )`, |
29 | `CREATE TABLE reports ( | ||
30 | id BIGSERIAL PRIMARY KEY, | ||
31 | date timestamp with time zone NOT NULL, | ||
32 | market_config_id bigint NOT NULL, | ||
33 | debug boolean | ||
34 | )`, | ||
35 | "CREATE INDEX IF NOT EXISTS reports_market_config_id ON reports (market_config_id)", | ||
29 | `CREATE TABLE report_lines ( | 36 | `CREATE TABLE report_lines ( |
30 | id BIGSERIAL PRIMARY KEY, | 37 | id BIGSERIAL PRIMARY KEY, |
31 | date timestamp with time zone NOT NULL, | 38 | date timestamp with time zone NOT NULL, |
32 | report_id bigint NOT NULL, | 39 | report_id bigint NOT NULL REFERENCES reports(id), |
33 | type text, | 40 | type text, |
34 | payload jsonb | 41 | payload jsonb |
35 | )`, | 42 | )`, |
36 | "CREATE INDEX IF NOT EXISTS report_lines_report_id ON report_lines (report_id)", | 43 | "CREATE INDEX IF NOT EXISTS report_lines_report_id ON report_lines (report_id)", |
37 | "CREATE INDEX IF NOT EXISTS report_lines_type ON report_lines (type)", | 44 | "CREATE INDEX IF NOT EXISTS report_lines_type ON report_lines (type)", |
38 | `CREATE TABLE reports ( | ||
39 | id BIGSERIAL PRIMARY KEY, | ||
40 | date timestamp with time zone NOT NULL, | ||
41 | market_config_id bigint NOT NULL, | ||
42 | debug boolean | ||
43 | )`, | ||
44 | "CREATE INDEX IF NOT EXISTS reports_market_config_id ON reports (market_config_id)", | ||
45 | }, | 45 | }, |
46 | Down: []string{"DROP TABLE users", "DROP TABLE market_configs", "DROP TABLE report_lines", "DROP TABLE reports"}, | 46 | Down: []string{"DROP TABLE users", "DROP TABLE market_configs", "DROP TABLE report_lines", "DROP TABLE reports"}, |
47 | }, | 47 | }, |