Skip to content

Instantly share code, notes, and snippets.

@ShurikAg
Created December 1, 2017 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShurikAg/64e23be9f92b0b5711e212745177bf89 to your computer and use it in GitHub Desktop.
Save ShurikAg/64e23be9f92b0b5711e212745177bf89 to your computer and use it in GitHub Desktop.
\d assignments
| Column | Type | Modifiers |
|----------------------------+--------------------------+-------------|
| id | uuid | not null |
| assignment_type | character varying(20) | not null |
| created_date | timestamp with time zone | not null |
| created_by_id | uuid | not null |
| updated_date | timestamp with time zone | not null |
| updated_by_id | uuid | not null |
| organization_id | uuid | not null |
| organization_membership_id | uuid | not null |
| task_id | uuid | |
| checklist_id | uuid | |
+----------------------------+--------------------------+-------------+
Indexes:
"assignments_pkey" PRIMARY KEY, btree (id)
"assignments_checklist_id_organization_membership_idx" UNIQUE, btree (checklist_id, organization_membership_id) WHERE checklis
"assignments_task_id_organization_membership_idx" UNIQUE, btree (task_id, organization_membership_id) WHERE task_id IS NOT NUL
"assignments_created_by_id_idx" btree (created_by_id)
"assignments_organization_membership_id_idx" btree (organization_membership_id)
"assignments_updated_by_id_idx" btree (updated_by_id)
Check constraints:
"assignments_type_check" CHECK (assignment_type::text = ANY (ARRAY['Task'::character varying, 'Checklist'::character varying]:
Foreign-key constraints:
"assignments_checklist_id_fkey" FOREIGN KEY (organization_id, checklist_id) REFERENCES checklists(organization_id, id)
"assignments_created_by_id_fkey" FOREIGN KEY (created_by_id) REFERENCES users(id)
"assignments_organization_membership_id_fkey" FOREIGN KEY (organization_membership_id) REFERENCES organization_memberships(id)
"assignments_task_id_fkey" FOREIGN KEY (organization_id, task_id) REFERENCES tasks(organization_id, id)
"assignments_updated_by_id_fkey" FOREIGN KEY (updated_by_id) REFERENCES users(id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment