Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created April 18, 2018 22:12
Show Gist options
  • Save erichocean/330ce2fd50e56b256d1a3cf8387148af to your computer and use it in GitHub Desktop.
Save erichocean/330ce2fd50e56b256d1a3cf8387148af to your computer and use it in GitHub Desktop.
root@c1.vultr.zuberglobal.com:26257/zuber> show create table marketplaces;
+--------------+--------------------------------------------------------------------------+
| Table | CreateTable |
+--------------+--------------------------------------------------------------------------+
| marketplaces | CREATE TABLE marketplaces ( |
| | |
| | id INTEGER NOT NULL, |
| | |
| | marketplace STRING NOT NULL, |
| | |
| | status INTEGER NOT NULL DEFAULT 0:::INT, |
| | |
| | CONSTRAINT "primary" PRIMARY KEY (id ASC), |
| | |
| | UNIQUE INDEX uq_marketplace (marketplace ASC), |
| | |
| | CONSTRAINT fk_status FOREIGN KEY (status) REFERENCES |
| | marketplace_status (enum), |
| | |
| | INDEX marketplaces_auto_index_fk_status (status ASC), |
| | |
| | FAMILY "primary" (id, marketplace, status) |
| | |
| | ) |
+--------------+--------------------------------------------------------------------------+
(1 row)
Time: 16.267986ms
root@c1.vultr.zuberglobal.com:26257/zuber> create table sellers ( marketplace int, id int, seller_marketplace_id string, primary key (marketplace, id) ) interleave in parent marketplaces (marketplace);
pq: declared interleaved columns (marketplace) must match type and sort direction of the parent's primary index (id)
root@c1.vultr.zuberglobal.com:26257/zuber>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment