Skip to content

Instantly share code, notes, and snippets.

@maracuja
maracuja / polymorphic.sql
Created July 17, 2020 11:08
Polymorphic Association Example
CREATE TABLE linkable (
id serial PRIMARY KEY
);
CREATE TABLE obja (
id integer not null,
name varchar(50) NOT NULL,
FOREIGN KEY(id) REFERENCES linkable(id)
);