-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from dekart-xyz/add-files
Upload files
- Loading branch information
Showing
40 changed files
with
5,272 additions
and
2,646 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,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); |
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,2 @@ | ||
ALTER TABLE queries | ||
ALTER COLUMN report_id drop not null; |
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,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 | ||
); |
Oops, something went wrong.