Skip to content

Commit

Permalink
Feature Request: Change varbinary to varchar in schemas used in examp…
Browse files Browse the repository at this point in the history
…les folder (#17318)

Signed-off-by: arthmis <[email protected]>
  • Loading branch information
arthmis authored Jan 3, 2025
1 parent b8b0383 commit b36b228
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 73 deletions.
4 changes: 2 additions & 2 deletions examples/backups/create_commerce_schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
create table if not exists product(
sku varbinary(128),
description varbinary(128),
sku varchar(128),
description varchar(128),
price bigint,
primary key(sku)
) ENGINE=InnoDB;
Expand Down
4 changes: 2 additions & 2 deletions examples/backups/create_customer_schema.sql
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
create table if not exists customer(
customer_id bigint not null,
email varbinary(128),
email varchar(128),
primary key(customer_id)
) ENGINE=InnoDB;

create table if not exists corder(
order_id bigint not null,
customer_id bigint,
sku varbinary(128),
sku varchar(128),
price bigint,
primary key(order_id)
) ENGINE=InnoDB;
6 changes: 3 additions & 3 deletions examples/compose/default_vschema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"sharded": false,
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
}
}
}
}
8 changes: 4 additions & 4 deletions examples/compose/lookup_keyspace_vschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"column_vindexes": [
{
"column": "id",
"name": "hash"
"name": "xxhash"
}
]
},
"tokens_token_lookup": {
"column_vindexes": [
{
"column": "id",
"name": "hash"
"name": "xxhash"
}
]
}
},
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
}
}
}
8 changes: 4 additions & 4 deletions examples/compose/test_keyspace_vschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"column_vindexes": [
{
"column": "page",
"name": "hash"
"name": "xxhash"
},
{
"column": "message",
Expand All @@ -17,7 +17,7 @@
"column_vindexes": [
{
"column": "page",
"name": "hash"
"name": "xxhash"
},
{
"column": "token",
Expand All @@ -27,8 +27,8 @@
}
},
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
},
"messages_message_lookup": {
"type": "lookup_hash",
Expand Down
9 changes: 4 additions & 5 deletions examples/compose/vtcompose/base_vschema.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
}
},
"tables": {
}
}
"tables": {}
}
70 changes: 42 additions & 28 deletions examples/demo/schema/customer/vschema.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
},
"corder_keyspace_idx": {
"type": "consistent_lookup_unique",
Expand Down Expand Up @@ -31,49 +31,63 @@
},
"tables": {
"customer": {
"column_vindexes": [{
"column": "customer_id",
"name": "hash"
}],
"column_vindexes": [
{
"column": "customer_id",
"name": "xxhash"
}
],
"auto_increment": {
"column": "customer_id",
"sequence": "product.customer_seq"
}
},
"corder": {
"column_vindexes": [{
"column": "customer_id",
"name": "hash"
}, {
"column": "corder_id",
"name": "corder_keyspace_idx"
}, {
"columns": ["oname", "corder_id"],
"name": "oname_keyspace_idx"
}],
"column_vindexes": [
{
"column": "customer_id",
"name": "xxhash"
},
{
"column": "corder_id",
"name": "corder_keyspace_idx"
},
{
"columns": [
"oname",
"corder_id"
],
"name": "oname_keyspace_idx"
}
],
"auto_increment": {
"column": "corder_id",
"sequence": "product.corder_seq"
}
},
"corder_event": {
"column_vindexes": [{
"column": "corder_id",
"name": "corder_keyspace_idx"
}, {
"column": "keyspace_id",
"name": "binary"
}],
"column_vindexes": [
{
"column": "corder_id",
"name": "corder_keyspace_idx"
},
{
"column": "keyspace_id",
"name": "binary"
}
],
"auto_increment": {
"column": "corder_event_id",
"sequence": "product.corder_event_seq"
}
},
"oname_keyspace_idx": {
"column_vindexes": [{
"column": "oname",
"name": "unicode_loose_md5"
}]
"column_vindexes": [
{
"column": "oname",
"name": "unicode_loose_md5"
}
]
}
}
}
}
8 changes: 4 additions & 4 deletions examples/local/create_commerce_schema.sql
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
create table if not exists product(
sku varbinary(128),
description varbinary(128),
sku varchar(128),
description varchar(128),
price bigint,
primary key(sku)
) ENGINE=InnoDB;
create table if not exists customer(
customer_id bigint not null auto_increment,
email varbinary(128),
email varchar(128),
primary key(customer_id)
) ENGINE=InnoDB;
create table if not exists corder(
order_id bigint not null auto_increment,
customer_id bigint,
sku varbinary(128),
sku varchar(128),
price bigint,
primary key(order_id)
) ENGINE=InnoDB;
8 changes: 4 additions & 4 deletions examples/local/vschema.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
}
},
"tables": {
"messages": {
"column_vindexes": [
{
"column": "page",
"name": "hash"
"name": "xxhash"
}
]
}
}
}
}
10 changes: 5 additions & 5 deletions examples/local/vschema_customer_sharded.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
}
},
"tables": {
"customer": {
"column_vindexes": [
{
"column": "customer_id",
"name": "hash"
"name": "xxhash"
}
],
"auto_increment": {
Expand All @@ -22,7 +22,7 @@
"column_vindexes": [
{
"column": "customer_id",
"name": "hash"
"name": "xxhash"
}
],
"auto_increment": {
Expand All @@ -31,4 +31,4 @@
}
}
}
}
}
8 changes: 4 additions & 4 deletions examples/operator/create_commerce_schema.sql
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
create table if not exists product(
sku varbinary(128),
description varbinary(128),
sku varchar(128),
description varchar(128),
price bigint,
primary key(sku)
) ENGINE=InnoDB;
create table if not exists customer(
customer_id bigint not null auto_increment,
email varbinary(128),
email varchar(128),
primary key(customer_id)
) ENGINE=InnoDB;
create table if not exists corder(
order_id bigint not null auto_increment,
customer_id bigint,
sku varbinary(128),
sku varchar(128),
price bigint,
primary key(order_id)
) ENGINE=InnoDB;
10 changes: 5 additions & 5 deletions examples/operator/vschema_customer_sharded.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
}
},
"tables": {
"customer": {
"column_vindexes": [
{
"column": "customer_id",
"name": "hash"
"name": "xxhash"
}
],
"auto_increment": {
Expand All @@ -22,7 +22,7 @@
"column_vindexes": [
{
"column": "customer_id",
"name": "hash"
"name": "xxhash"
}
],
"auto_increment": {
Expand All @@ -31,4 +31,4 @@
}
}
}
}
}
6 changes: 3 additions & 3 deletions examples/region_sharding/create_main_schema.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE IF NOT EXISTS customer (
id int NOT NULL,
fullname varbinary(256),
nationalid varbinary(256),
country varbinary(256),
fullname varchar(256),
nationalid varchar(256),
country varchar(256),
primary key(id)
);

0 comments on commit b36b228

Please sign in to comment.