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

Reviewed-on: #10
Co-authored-by: Joseph Nelson <joseph.nelson4456@gmail.com>
Co-committed-by: Joseph Nelson <joseph.nelson4456@gmail.com>
This commit was merged in pull request #10.
This commit is contained in:
2026-05-18 22:57:29 -07:00
committed by joseph.nelson4456
parent e352a26c66
commit a41f16132d
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -20,4 +20,4 @@ WORKDIR /app
COPY . . COPY . .
RUN npm install --force 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')
}