I am using helm and the file 101_initial_cluster.yaml from the Vitess example to setup my initial cluster. The example has a schema initialization using SQL string as shown below:
schema:
initial: |-
create table product(
sku varbinary(128),
description varbinary(128),
price bigint,
primary key(sku)
);
create table customer(
customer_id bigint not null auto_increment,
email varbinary(128),
primary key(customer_id)
);
create table corder(
order_id bigint not null auto_increment,
customer_id bigint,
sku varbinary(128),
price bigint,
primary key(order_id)
);
I would like to replace this with a file initial: my_initial_keyspace_schema.sql
. From the Vitess documentation I can see Vitess does allow for this using ApplySchema -sql_file=user_table.sql user
, but I would like to initialize using the helm file.
This would be very helpful as it is very tedious to organize and paste the schema as a string
. Tables that depend on others have to be pasted first and the rest follow. Forgetting makes Vitess throw an error.