-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: now we can upload video per log (#138)
* feat: now we can upload video per log * chore: remove un-used code
- Loading branch information
Showing
13 changed files
with
317 additions
and
12 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
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
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
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
Empty file.
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,5 @@ | ||
import db from '../../../../database/db.js'; | ||
|
||
export function insertVideo(details) { | ||
return db.insert(details).into('videos').returning('*'); | ||
} |
Empty file.
Empty file.
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
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
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
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,31 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export async function up(knex) { | ||
// videos | ||
await knex.schema.raw(` | ||
CREATE TABLE IF NOT EXISTS videos ( | ||
id SERIAL PRIMARY KEY, | ||
video_url VARCHAR(1000) DEFAULT NULL, | ||
video_path VARCHAR(1000) DEFAULT NULL, | ||
screenshot_url VARCHAR(1000) DEFAULT NULL, | ||
screenshot_path VARCHAR(1000) DEFAULT NULL, | ||
user_id INT REFERENCES users on DELETE CASCADE NOT NULL, | ||
log_id INT REFERENCES logs on DELETE CASCADE NOT NULL, | ||
session_id INT REFERENCES sessions on DELETE CASCADE, | ||
json jsonb DEFAULT NULL, | ||
deleted BOOLEAN DEFAULT FALSE, | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
updated_at TIMESTAMP NOT NULL DEFAULT NOW() | ||
); | ||
`); | ||
} | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export async function down(knex) { | ||
await knex.schema.raw(`DROP TABLE IF EXISTS videos;`); | ||
} |
Oops, something went wrong.