2021-04-17 09:06:57 +02:00
|
|
|
CREATE TABLE IF NOT EXISTS {{.prefix}}blocks (
|
2020-10-16 22:27:16 +02:00
|
|
|
id VARCHAR(36),
|
2021-04-22 22:53:01 +02:00
|
|
|
{{if .postgres}}insert_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),{{end}}
|
|
|
|
{{if .sqlite}}insert_at DATETIME NOT NULL DEFAULT(STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),{{end}}
|
|
|
|
{{if .mysql}}insert_at DATETIME(6) NOT NULL DEFAULT NOW(6),{{end}}
|
2020-10-16 22:27:16 +02:00
|
|
|
parent_id VARCHAR(36),
|
2021-04-22 22:53:01 +02:00
|
|
|
{{if .mysql}}`schema`{{else}}schema{{end}} BIGINT,
|
2020-10-16 22:27:16 +02:00
|
|
|
type TEXT,
|
|
|
|
title TEXT,
|
2021-04-20 11:27:20 +02:00
|
|
|
fields {{if .postgres}}JSON{{else}}TEXT{{end}},
|
2020-10-16 22:27:16 +02:00
|
|
|
create_at BIGINT,
|
|
|
|
update_at BIGINT,
|
|
|
|
delete_at BIGINT,
|
|
|
|
PRIMARY KEY (id, insert_at)
|
2021-09-08 06:52:03 +02:00
|
|
|
) {{if .mysql}}DEFAULT CHARACTER SET utf8mb4{{end}};
|