diff --git a/src/tools/sync-stashes.js b/src/tools/sync-stashes.js index a278763..8de6351 100644 --- a/src/tools/sync-stashes.js +++ b/src/tools/sync-stashes.js @@ -38,6 +38,33 @@ async function syncStashes(domain = 'scene') { } async function init() { + await utilsApi.sql('drop table if exists scenes_stashed'); + + await utilsApi.sql(`create table if not exists scenes_stashed ( + scene_id int, + stash_id int, + user_id int, + created_at timestamp + )`); + + await utilsApi.sql('drop table if exists movies_stashed'); + + await utilsApi.sql(`create table if not exists movies_stashed ( + movie_id int, + stash_id int, + user_id int, + created_at timestamp + )`); + + await utilsApi.sql('drop table if exists actors_stashed'); + + await utilsApi.sql(`create table if not exists actors_stashed ( + actor_id int, + stash_id int, + user_id int, + created_at timestamp + )`); + await syncStashes('scene'); await syncStashes('actor'); await syncStashes('movie');