...
 
Commits (2)
......@@ -458,6 +458,7 @@ CREATE TABLE d.orders (
PRIMARY KEY (customer, id),
CONSTRAINT fk_customer FOREIGN KEY (customer) REFERENCES d.customers
) INTERLEAVE IN PARENT d.customers (customer);
CREATE INDEX i ON d.orders (customer, total) INTERLEAVE IN PARENT d.customers (customer);
`
_, err := c.RunWithCaptureArgs([]string{"sql", "-e", create})
......@@ -480,7 +481,7 @@ CREATE TABLE orders (
) INTERLEAVE IN PARENT customers (customer);
ALTER TABLE orders ADD CONSTRAINT fk_customer FOREIGN KEY (customer) REFERENCES customers(id);
CREATE UNIQUE INDEX "primary" ON orders (customer ASC, id ASC) INTERLEAVE IN PARENT customers (customer);
CREATE INDEX i ON orders (customer ASC, total ASC) INTERLEAVE IN PARENT customers (customer);
-- Validate foreign key constraints. These can fail if there was unvalidated data during the dump.
ALTER TABLE orders VALIDATE CONSTRAINT fk_customer;
......
......@@ -109,9 +109,5 @@ CREATE TABLE d (
CONSTRAINT "primary" PRIMARY KEY (x ASC, y DESC, z DESC),
FAMILY "primary" (x, y, z)
) INTERLEAVE IN PARENT a (x, y);
CREATE UNIQUE INDEX "primary" ON d (x ASC, y DESC, z DESC) INTERLEAVE IN PARENT a (x, y);
-- Validate foreign key constraints. These can fail if there was unvalidated data during the dump.
----
----
......@@ -1411,8 +1411,7 @@ CREATE TABLE crdb_internal.create_statements (
if err != nil {
return err
}
allIdx := append(table.Indexes, table.PrimaryIndex)
if err := showAlterStatementWithInterleave(ctx, tn, contextName, lCtx, allIdx, table, alterStmts, validateStmts); err != nil {
if err := showAlterStatementWithInterleave(ctx, tn, contextName, lCtx, table.Indexes, table, alterStmts, validateStmts); err != nil {
return err
}
stmt, err = ShowCreateTable(ctx, p, tn, contextName, table, lCtx, IncludeFkClausesInCreate)
......