Project-Books / books-api

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

Use BigInt for IDs in publisher_book #147

Closed knjk04 closed 2 years ago

knjk04 commented 2 years ago

Our publisher_book table:

CREATE TABLE publisher_book (
    publisher_id BIGSERIAL NOT NULL,
    book_id      BIGSERIAL NOT NULL,
    PRIMARY KEY (publisher_id, book_id),
    FOREIGN KEY (publisher_id) REFERENCES publisher (id),
    FOREIGN KEY (book_id)      REFERENCES book (id)
)

We should not be using BIGSERIAL for the IDs as we do not want them to auto-increment. Instead, we use BIGINT.