Skip to content

Instantly share code, notes, and snippets.

@sloppyfocus
Created July 16, 2014 23:06
Show Gist options
  • Save sloppyfocus/eb74ee745865b54f989d to your computer and use it in GitHub Desktop.
Save sloppyfocus/eb74ee745865b54f989d to your computer and use it in GitHub Desktop.
postgres@[local] clusto=# \d entities
Table "public.entities"
Column | Type | Modifiers
--------------------+------------------------+--------------------------------------------------------------
entity_id | integer | not null default nextval('entities_entity_id_seq'::regclass)
name | character varying(128) | not null
type | character varying(32) | not null
driver | character varying(32) | not null
version | integer | not null
deleted_at_version | integer |
Indexes:
"entities_pkey" PRIMARY KEY, btree (entity_id)
"idx_entity_name_version" btree (name, version, deleted_at_version)
Referenced by:
TABLE "counters" CONSTRAINT "counters_entity_id_fkey" FOREIGN KEY (entity_id) REFERENCES entities(entity_id)
TABLE "entity_attrs" CONSTRAINT "entity_attrs_entity_id_fkey" FOREIGN KEY (entity_id) REFERENCES entities(entity_id)
TABLE "entity_attrs" CONSTRAINT "entity_attrs_relation_id_fkey" FOREIGN KEY (relation_id) REFERENCES entities(entity_id)
postgres@[local] clusto=# \d entity_attrs
Column | Type | Modifiers
--------------------+-----------------------------+----------------------------------------------------------------
attr_id | integer | not null default nextval('entity_attrs_attr_id_seq'::regclass)
entity_id | integer | not null
key | character varying(256) |
subkey | character varying(256) |
number | integer |
datatype | character varying(32) | not null
int_value | bigint |
string_value | text |
datetime_value | timestamp without time zone |
relation_id | integer |
version | integer | not null
deleted_at_version | integer |
Indexes:
"entity_attrs_pkey" PRIMARY KEY, btree (attr_id)
"idx_attrs_entity_version" btree (entity_id, version, deleted_at_version)
"idx_attrs_key" btree (key)
"idx_attrs_str_value" btree ("substring"(string_value, 0, 20))
"idx_attrs_subkey" btree (subkey)
Foreign-key constraints:
"entity_attrs_entity_id_fkey" FOREIGN KEY (entity_id) REFERENCES entities(entity_id)
"entity_attrs_relation_id_fkey" FOREIGN KEY (relation_id) REFERENCES entities(entity_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment