Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (26 sloc) 1.323 kB
CREATE TABLE IF NOT EXISTS shards (
class_name VARCHAR(125) NOT NULL,
table_prefix VARCHAR(125) NOT NULL,
hostname VARCHAR(25) NOT NULL,
source_type VARCHAR(125),
destination_type VARCHAR(125),
busy TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY primary_key_table_prefix_hostname (hostname, table_prefix)
) ENGINE=INNODB;
CREATE TABLE IF NOT EXISTS shard_children (
parent_hostname VARCHAR(125) NOT NULL,
parent_table_prefix VARCHAR(125) NOT NULL,
child_hostname VARCHAR(125) NOT NULL,
child_table_prefix VARCHAR(125) NOT NULL,
weight INT NOT NULL DEFAULT 1,
PRIMARY KEY primary_key_family (parent_hostname, parent_table_prefix, child_hostname, child_table_prefix),
INDEX child (child_hostname, child_table_prefix)
) ENGINE=INNODB;
CREATE TABLE IF NOT EXISTS forwardings (
base_source_id BIGINT NOT NULL,
table_id INT NOT NULL,
shard_hostname VARCHAR(125) NOT NULL,
shard_table_prefix VARCHAR(125) NOT NULL,
PRIMARY KEY (base_source_id, table_id),
UNIQUE unique_shard (shard_hostname, shard_table_prefix)
) ENGINE=INNODB;
Jump to Line
Something went wrong with that request. Please try again.