trying a CMD fix for docker and added FK relationship to users table #10

Merged
joseph.nelson4456 merged 1 commits from fix-dockerfile-command-and-update-migrations into main 2026-05-18 22:57:30 -07:00
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -20,4 +20,4 @@ WORKDIR /app
COPY . .
RUN npm install --force
CMD ["npm", "run", "start"]
CMD npm run start
@@ -0,0 +1,13 @@
export const up = (pgm) => {
pgm.sql(
'ALTER TABLE collections ADD CONSTRAINT fk_collections_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE'
)
pgm.sql(
'ALTER TABLE sets ADD CONSTRAINT fk_sets_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE'
)
}
export const down = (pgm) => {
pgm.sql('ALTER TABLE collections DROP CONSTRAINT fk_collections_user_id')
pgm.sql('ALTER TABLE sets DROP CONSTRAINT fk_sets_user_id')
}