Project-Books / books-api

GraphQL Books API
https://project-books.github.io/#books-api
MIT License
35 stars 60 forks source link

Cannot drop publisher_book foreign keys #99

Closed knjk04 closed 2 years ago

knjk04 commented 3 years ago

Describe the bug In V010__RENAME_PUBLISHER_BOOK_CONSTRAINTS.sql, we attempt to drop some foreign keys. However, it looks like we've already renamed them, so we need to first check whether the foreign keys with the obscure names exist.

ALTER TABLE publisher_book
DROP FOREIGN KEY FK6buft2dj1d6ig7hekbx7c0ysp,
ADD CONSTRAINT publisher_book_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id);

ALTER TABLE publisher_book
DROP FOREIGN KEY FKnro4ab7u1j42osd4sehbkptrr,
ADD CONSTRAINT publisher_book_book_id FOREIGN KEY (book_id) REFERENCES book (id);

To Reproduce Steps to reproduce the behavior:

  1. Run the app
  2. See error

Expected behavior App runs without any build errors.

lawynnj commented 3 years ago

Just a heads up, this is blocking https://github.com/Project-Books/books-api/issues/57.

knjk04 commented 3 years ago

@lawynnj As a temporary solution, you can remove that file

knjk04 commented 2 years ago

This file has been removed