/
20210104145901_context_tables.up.fizz
30 lines (26 loc) · 1.23 KB
/
20210104145901_context_tables.up.fizz
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
{{ if eq .Dialect "sqlite3" }}
create_table("context_prefix_a_table") {
t.Column("id", "string", { primary: true })
t.Column("value", "string")
}
create_table("context_prefix_b_table") {
t.Column("id", "string", { primary: true })
t.Column("value", "string")
}
{{ end }}
{{ if eq .Dialect "mysql" }}
create_table("context_prefix_a_table") {
t.Column("id", "string", { primary: true })
t.Column("value", "string")
}
create_table("context_prefix_b_table") {
t.Column("id", "string", { primary: true })
t.Column("value", "string")
}
{{ end }}
{{ if eq .Dialect "postgres" }}
sql("CREATE SCHEMA context_prefix_a")
sql("CREATE SCHEMA context_prefix_b")
sql("CREATE TABLE IF NOT EXISTS \"context_prefix_a\".\"a_table\" (id character varying(255) NOT NULL, value character varying(255) NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL)")
sql("CREATE TABLE IF NOT EXISTS \"context_prefix_b\".\"b_table\" (id character varying(255) NOT NULL, value character varying(255) NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL)")
{{ end }}