cockroachdb / appdev-issues

This is an issue repository for misc AppDev team issues.
1 stars 1 forks source link

liquibase: reproduce issue with FAMILY in schema #24

Closed rafiss closed 4 years ago

rafiss commented 4 years ago

See the Slack thread for more info: https://cockroachlabs.slack.com/archives/CUG42HAN9/p1590500097054500

Dataical has added a cockroachdb-support branch that has a CockroachDatabase class.

When using Liquibase to make a table definition like this in CockroachDB, it errors out.

CREATE TABLE "order" (
  o_id INT8 NOT NULL,
  o_d_id INT8 NOT NULL,
  o_w_id INT8 NOT NULL,
  o_c_id INT8 NULL,
  o_entry_d TIMESTAMP NULL,
  o_carrier_id INT8 NULL,
  o_ol_cnt INT8 NULL,
  o_all_local INT8 NULL,
  CONSTRAINT "primary" PRIMARY KEY (o_w_id ASC, o_d_id ASC, o_id DESC),
  UNIQUE INDEX order_idx (o_w_id ASC, o_d_id ASC, o_c_id ASC, o_id DESC) STORING (o_entry_d, o_carrier_id),
  FAMILY "primary" (o_id, o_d_id, o_w_id, o_c_id, o_entry_d, o_carrier_id, o_ol_cnt, o_all_local)
)

You can also see it has a FAMILY clause which is a cockroach-specific thing. There is no support in liquibase for this, but their test will not find that it’s missing. We’ll just generate the changelog and it will correctly run without error. But, it would also not create the column family like originally requested.

For this ticket, reproduce the failure, and determine why it's happening.