Skip to content

Instantly share code, notes, and snippets.

@erichanson
Last active August 29, 2015 13:56
Show Gist options
  • Save erichanson/9262875 to your computer and use it in GitHub Desktop.
Save erichanson/9262875 to your computer and use it in GitHub Desktop.
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+-------
spy | affiliation | table | eric
spy | affiliationrel | table | eric
spy | agent | table | eric
spy | language | table | eric
spy | languagerel | table | eric
spy | mission | table | eric
spy | securityclearance | table | eric
spy | skill | table | eric
spy | skillrel | table | eric
spy | team | table | eric
spy | teamrel | table | eric
Table "spy.affiliation"
Column | Type | Modifiers
-------------+-----------------------+-----------
aff_id | integer | not null
title | character varying(20) |
description | character varying(50) |
Referenced by:
TABLE "affiliationrel" CONSTRAINT "affiliationrel_aff_id_fkey" FOREIGN KEY (aff_id) REFERENCES affiliation(aff_id)
Table "spy.affiliationrel"
Column | Type | Modifiers
----------------------+-----------------------+-----------
aff_id | integer | not null
agent_id | integer | not null
affiliation_strength | character varying(10) |
Foreign-key constraints:
"affiliationrel_aff_id_fkey" FOREIGN KEY (aff_id) REFERENCES affiliation(aff_id)
"affiliationrel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
Table "spy.agent"
Column | Type | Modifiers
--------------+-----------------------+-----------
agent_id | integer | not null
first | character varying(20) |
middle | character varying(20) |
last | character varying(20) |
address | character varying(50) |
city | character varying(20) |
country | character varying(20) |
salary | integer |
clearance_id | integer |
Foreign-key constraints:
"agent_clearance_id_fkey" FOREIGN KEY (clearance_id) REFERENCES securityclearance(sc_id)
Referenced by:
TABLE "affiliationrel" CONSTRAINT "affiliationrel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
TABLE "languagerel" CONSTRAINT "languagerel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
TABLE "skillrel" CONSTRAINT "skillrel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
TABLE "teamrel" CONSTRAINT "teamrel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
Table "spy.language"
Column | Type | Modifiers
----------+-----------------------+-----------
lang_id | integer | not null
language | character varying(20) |
Referenced by:
TABLE "languagerel" CONSTRAINT "languagerel_lang_id_fkey" FOREIGN KEY (lang_id) REFERENCES language(lang_id)
Table "spy.languagerel"
Column | Type | Modifiers
----------+---------+-----------
lang_id | integer | not null
agent_id | integer | not null
Foreign-key constraints:
"languagerel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
"languagerel_lang_id_fkey" FOREIGN KEY (lang_id) REFERENCES language(lang_id)
Table "spy.mission"
Column | Type | Modifiers
----------------+-----------------------+-----------
mission_id | integer | not null
name | character varying(20) |
access_id | integer |
team_id | integer |
mission_status | character varying(20) |
Foreign-key constraints:
"mission_access_id_fkey" FOREIGN KEY (access_id) REFERENCES securityclearance(sc_id)
"mission_team_id_fkey" FOREIGN KEY (team_id) REFERENCES team(team_id)
Table "spy.securityclearance"
Column | Type | Modifiers
-------------+-----------------------+-----------
sc_id | integer | not null
sc_level | character varying(20) |
description | character varying(50) |
Referenced by:
TABLE "agent" CONSTRAINT "agent_clearance_id_fkey" FOREIGN KEY (clearance_id) REFERENCES securityclearance(sc_id)
TABLE "mission" CONSTRAINT "mission_access_id_fkey" FOREIGN KEY (access_id) REFERENCES securityclearance(sc_id)
Table "spy.skill"
Column | Type | Modifiers
----------+-----------------------+-----------
skill_id | integer | not null
skill | character varying(20) |
Referenced by:
TABLE "skillrel" CONSTRAINT "skillrel_skill_id_fkey" FOREIGN KEY (skill_id) REFERENCES skill(skill_id)
Column | Type | Modifiers
----------+---------+-----------
skill_id | integer | not null
agent_id | integer | not null
Foreign-key constraints:
"skillrel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
"skillrel_skill_id_fkey" FOREIGN KEY (skill_id) REFERENCES skill(skill_id)
Table "spy.team"
Column | Type | Modifiers
-------------------+-----------------------+-----------
team_id | integer | not null
name | character varying(20) |
meeting_frequency | character varying(20) |
Referenced by:
TABLE "mission" CONSTRAINT "mission_team_id_fkey" FOREIGN KEY (team_id) REFERENCES team(team_id)
TABLE "teamrel" CONSTRAINT "teamrel_team_id_fkey" FOREIGN KEY (team_id) REFERENCES team(team_id)
Table "spy.teamrel"
Column | Type | Modifiers
----------+---------+-----------
team_id | integer | not null
agent_id | integer | not null
Foreign-key constraints:
"teamrel_agent_id_fkey" FOREIGN KEY (agent_id) REFERENCES agent(agent_id)
"teamrel_team_id_fkey" FOREIGN KEY (team_id) REFERENCES team(team_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment