Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data export migration #222

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@datalens-tech/datalens-us",
"description": "United Storage",
"version": "0.0.0",
"version": "0.278.0",
"private": true,
"author": "DataLens Team <https://github.com/datalens-tech>",
"license": "Apache-2.0",
Expand Down
30 changes: 30 additions & 0 deletions src/db/migrations/20241219092946_data_export.ts
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;
`);
}
Loading