Skip to content

Foreign keys #44

Description

@HettieM

It's a good idea to label fields as foreign keys in your schema - doesn't appear to be entirely necessary, but it's good practice for "referential integrity".
e.g.
CREATE TBALE decks
(
deck_id SERIAL PRIMARY KEY,
owner_id INTEGER,
deck_name VARCHAR(255) NOT NULL,
published BOOLEAN DEFAULT false,
FOREIGN KEY (owner_id) REFERENCES users(user_id)
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions