Skip to content

Commit

Permalink
Added bootstrap folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sriharsha Chintalapani committed Oct 31, 2016
1 parent 93068a1 commit 9b823f2
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
59 changes: 59 additions & 0 deletions bootstrap/sql/mysql/create_tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-- CREATE DATABASE IF NOT EXISTS schema_registry;
-- USE schema_registry;

-- THE NAMES OF THE TABLE COLUMNS MUST MATCH THE NAMES OF THE CORRESPONDING CLASS MODEL FIELDS
CREATE TABLE IF NOT EXISTS schema_metadata_info (
id BIGINT AUTO_INCREMENT NOT NULL,
type VARCHAR(256) NOT NULL,
schemaGroup VARCHAR(256) NOT NULL,
name VARCHAR(256) NOT NULL,
compatibility VARCHAR(256) NOT NULL,
description TEXT,
timestamp BIGINT NOT NULL,
PRIMARY KEY (name),
UNIQUE KEY (id)
);

CREATE TABLE IF NOT EXISTS schema_version_info (
id BIGINT AUTO_INCREMENT NOT NULL,
description TEXT,
schemaText TEXT NOT NULL,
fingerprint TEXT NOT NULL,
version INT NOT NULL,
schemaMetadataId BIGINT NOT NULL,
timestamp BIGINT NOT NULL,
name VARCHAR(256) NOT NULL,
UNIQUE KEY (id),
UNIQUE KEY `UK_METADATA_ID_VERSION_FK` (schemaMetadataId, version),
PRIMARY KEY (name, version),
FOREIGN KEY (schemaMetadataId, name) REFERENCES schema_metadata_info (id, name)
);

CREATE TABLE IF NOT EXISTS schema_field_info (
id BIGINT AUTO_INCREMENT NOT NULL,
schemaInstanceId BIGINT NOT NULL,
timestamp BIGINT NOT NULL,
name VARCHAR(256) NOT NULL,
fieldNamespace VARCHAR(256),
type VARCHAR(256) NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (schemaInstanceId) REFERENCES schema_version_info (id)
);

CREATE TABLE IF NOT EXISTS schema_serdes_info (
id BIGINT AUTO_INCREMENT NOT NULL,
description TEXT,
name TEXT NOT NULL,
fileId TEXT NOT NULL,
className TEXT NOT NULL,
isSerializer BOOLEAN NOT NULL,
timestamp BIGINT NOT NULL,
PRIMARY KEY (id)
);

CREATE TABLE IF NOT EXISTS schema_serdes_mapping (
schemaMetadataId BIGINT NOT NULL,
serDesId BIGINT NOT NULL,

UNIQUE KEY `UK_IDS` (schemaMetadataId, serdesId)
);
7 changes: 7 additions & 0 deletions registry-dist/src/main/assembly/binary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
</includes>
<fileMode>0755</fileMode>
</fileSet>
<!--
$REGISTRY_HOME/bin
-->
<fileSet>
<directory>${project.basedir}./bootstrap</directory>
<outputDirectory>bootstrap</outputDirectory>
</fileSet>
<!--
EXAMPLES
-->
Expand Down

0 comments on commit 9b823f2

Please sign in to comment.