I have the following tables:
users
- id INT PK
- created_at DATETIME
- updated_at DATETIME
- is_archived BOOLEAN
- name VARCHAR
publishers
- id INT PK
- created_at DATETIME
- updated_at DATETIME
- is_archived BOOLEAN
- name VARCHAR
subscriptions
- user_id INT PK,FK
- publisher_id INT PK,FK
I want to have additional attributes in my the subscriptions such as created_at, updated_at and is_archived (like all other tables) and other fields.
My options are:
- user_id INT PK,FK
- publisher_id INT PK,FK
- created_at DATETIME
- updated_at DATETIME
- is_archived BOOLEAN
- expires_at DATETIME
OR
- id INT PK
- user_id INT FK
- publisher_id INT FK
- created_at DATETIME
- updated_at DATETIME
- is_archived BOOLEAN
- expires_at DATETIME
What are the pros/cons of having an autoincrement key instead of using both foreign keys as a primary composite key?