Skip to content

Commit

Permalink
Merge pull request #41 from dekart-xyz/add-files
Browse files Browse the repository at this point in the history
Upload files
  • Loading branch information
delfrrr authored Nov 12, 2022
2 parents ad097a6 + 157f557 commit 750ac25
Show file tree
Hide file tree
Showing 40 changed files with 5,272 additions and 2,646 deletions.
14 changes: 14 additions & 0 deletions migrations/000009_create_files_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS files (
id uuid NOT NULL,
file_source_id uuid,
name varchar DEFAULT '',
size bigint DEFAULT 0,
mime_type varchar DEFAULT '',
file_status int DEFAULT 1,
upload_error text DEFAULT '',
updated_at timestamptz DEFAULT CURRENT_TIMESTAMP,
created_at timestamptz DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id)
);

CREATE INDEX IF NOT EXISTS files_file_source_id_idx ON files (file_source_id);
2 changes: 2 additions & 0 deletions migrations/000010_queries_alter_report_id.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE queries
ALTER COLUMN report_id drop not null;
12 changes: 12 additions & 0 deletions migrations/000011_create_dataset_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS datasets (
report_id uuid NOT NULL,
id uuid NOT NULL,
query_id uuid,
file_id uuid,
updated_at timestamptz DEFAULT CURRENT_TIMESTAMP,
created_at timestamptz DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id),
CONSTRAINT fk_report FOREIGN KEY(report_id) REFERENCES reports,
CONSTRAINT fk_file FOREIGN KEY(file_id) REFERENCES files,
CONSTRAINT fk_query FOREIGN KEY(query_id) REFERENCES queries
);
Loading

0 comments on commit 750ac25

Please sign in to comment.