Skip to content

Commit 3d7148f

Browse files
goffrieConvex, Inc.
authored andcommitted
Change mysql ID columns to BINARY(16) (#43952)
GitOrigin-RevId: 566d4cf5388ad7ef02f6135e77910110d070b166
1 parent 8bcf05f commit 3d7148f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/mysql/src/sql.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ pub const fn init_sql(multitenant: bool) -> &'static str {
7777
r#"
7878
CREATE TABLE IF NOT EXISTS @db_name.documents (
7979
{instance_col_def}
80-
id VARBINARY(32) NOT NULL,
80+
id BINARY(16) NOT NULL,
8181
ts BIGINT NOT NULL,
8282
83-
table_id VARBINARY(32) NOT NULL,
83+
table_id BINARY(16) NOT NULL,
8484
8585
json_value LONGBLOB NOT NULL,
8686
deleted BOOLEAN DEFAULT false,
@@ -94,7 +94,7 @@ pub const fn init_sql(multitenant: bool) -> &'static str {
9494
CREATE TABLE IF NOT EXISTS @db_name.indexes (
9595
{instance_col_def}
9696
/* ids should be serialized as bytes but we keep it compatible with documents */
97-
index_id VARBINARY(32) NOT NULL,
97+
index_id BINARY(16) NOT NULL,
9898
ts BIGINT NOT NULL,
9999
100100
/*
@@ -113,8 +113,8 @@ pub const fn init_sql(multitenant: bool) -> &'static str {
113113
114114
deleted BOOLEAN,
115115
/* table_id and document_id should be populated iff deleted is false. */
116-
table_id VARBINARY(32) NULL,
117-
document_id VARBINARY(32) NULL,
116+
table_id BINARY(16) NULL,
117+
document_id BINARY(16) NULL,
118118
119119
PRIMARY KEY ({instance_col} index_id, key_prefix, key_sha256, ts)
120120
) ROW_FORMAT=DYNAMIC;

0 commit comments

Comments
 (0)