Added a new sync that uses hash
Added a new sync that uses hash and sqlc for the queries. Added db migration. Started adding a config file.
This commit is contained in:
19
db/migrations/000002_adjust_fields_for_sqlc.up.sql
Normal file
19
db/migrations/000002_adjust_fields_for_sqlc.up.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
BEGIN;
|
||||
UPDATE game
|
||||
SET number_of_songs = 0
|
||||
WHERE number_of_songs IS NULL;
|
||||
UPDATE game
|
||||
SET hash = ''
|
||||
WHERE hash IS NULL;
|
||||
UPDATE song
|
||||
SET hash = ''
|
||||
WHERE hash IS NULL;
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
Alter table game
|
||||
alter column number_of_songs set not null,
|
||||
alter column number_of_songs set default 0,
|
||||
ALTER COLUMN hash SET NOT NULL;
|
||||
ALTER TABLE song
|
||||
ALTER COLUMN hash SET NOT NULL;
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user