-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb1f43b
commit c5ea22d
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type {Knex} from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
CREATE TABLE data_export ( | ||
data_export_id BIGINT NOT NULL PRIMARY KEY DEFAULT get_id(), | ||
title TEXT NOT NULL, | ||
tenant_id TEXT, | ||
chart_id BIGINT NOT NULL, | ||
chart_rev_id BIGINT NOT NULL, | ||
dataset_id BIGINT, | ||
dataset_rev_id BIGINT NOT NULL, | ||
connection_id BIGINT NOT NULL, | ||
connection_rev_id BIGINT NOT NULL, | ||
params JSONB NOT NULL DEFAULT '{}'::jsonb, | ||
created_by TEXT NOT NULL, | ||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), | ||
expired_at TIMESTAMPTZ NOT NULL, | ||
job_id TEXT NOT NULL, | ||
result_link TEXT, | ||
error JSONB | ||
); | ||
`); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
DROP TABLE data_export; | ||
`); | ||
} |