Details
diff --git a/account/src/main/resources/org/killbill/billing/account/ddl.sql b/account/src/main/resources/org/killbill/billing/account/ddl.sql
index c29b2a8..bfb4ce1 100644
--- a/account/src/main/resources/org/killbill/billing/account/ddl.sql
+++ b/account/src/main/resources/org/killbill/billing/account/ddl.sql
@@ -27,7 +27,7 @@ CREATE TABLE accounts (
created_by varchar(50) NOT NULL,
updated_date datetime DEFAULT NULL,
updated_by varchar(50) DEFAULT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX accounts_id ON accounts(id);
@@ -38,7 +38,7 @@ DROP TABLE IF EXISTS account_history;
CREATE TABLE account_history (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
external_key varchar(128) NULL,
email varchar(128) DEFAULT NULL,
name varchar(100) DEFAULT NULL,
@@ -63,7 +63,7 @@ CREATE TABLE account_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX account_history_target_record_id ON account_history(target_record_id);
@@ -80,8 +80,8 @@ CREATE TABLE account_emails (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX account_email_id ON account_emails(id);
@@ -92,7 +92,7 @@ DROP TABLE IF EXISTS account_email_history;
CREATE TABLE account_email_history (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
account_id char(36) NOT NULL,
email varchar(128) NOT NULL,
is_active bool DEFAULT true,
@@ -101,8 +101,8 @@ CREATE TABLE account_email_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX account_email_target_record_id ON account_email_history(target_record_id);
diff --git a/beatrix/src/main/resources/org/killbill/billing/beatrix/ddl.sql b/beatrix/src/main/resources/org/killbill/billing/beatrix/ddl.sql
index 9a64640..84ae5cd 100644
--- a/beatrix/src/main/resources/org/killbill/billing/beatrix/ddl.sql
+++ b/beatrix/src/main/resources/org/killbill/billing/beatrix/ddl.sql
@@ -11,9 +11,9 @@ CREATE TABLE bus_ext_events (
processing_owner char(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
- error_count int(11) unsigned DEFAULT 0,
- search_key1 bigint unsigned not null,
- search_key2 bigint unsigned not null default 0,
+ error_count int(11) /*! unsigned */ DEFAULT 0,
+ search_key1 bigint /*! unsigned */ not null,
+ search_key2 bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX `idx_bus_ext_where` ON bus_ext_events (`processing_state`,`processing_owner`,`processing_available_date`);
@@ -30,8 +30,8 @@ CREATE TABLE bus_ext_events_history (
processing_owner char(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
- error_count int(11) unsigned DEFAULT 0,
- search_key1 bigint unsigned not null,
- search_key2 bigint unsigned not null default 0,
+ error_count int(11) /*! unsigned */ DEFAULT 0,
+ search_key1 bigint /*! unsigned */ not null,
+ search_key2 bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
diff --git a/catalog/src/main/resources/org/killbill/billing/catalog/ddl.sql b/catalog/src/main/resources/org/killbill/billing/catalog/ddl.sql
index f2d11b5..ab0b058 100644
--- a/catalog/src/main/resources/org/killbill/billing/catalog/ddl.sql
+++ b/catalog/src/main/resources/org/killbill/billing/catalog/ddl.sql
@@ -8,7 +8,7 @@ CREATE TABLE catalog_override_plan_definition (
is_active bool DEFAULT 1,
created_date datetime NOT NULL,
created_by varchar(50) NOT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX catalog_override_plan_definition_tenant_record_id ON catalog_override_plan_definition(tenant_record_id);
@@ -24,7 +24,7 @@ CREATE TABLE catalog_override_phase_definition (
effective_date datetime NOT NULL,
created_date datetime NOT NULL,
created_by varchar(50) NOT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX catalog_override_phase_definition_idx ON catalog_override_phase_definition(tenant_record_id, parent_phase_name, currency);
@@ -32,12 +32,12 @@ CREATE INDEX catalog_override_phase_definition_idx ON catalog_override_phase_def
DROP TABLE IF EXISTS catalog_override_plan_phase;
CREATE TABLE catalog_override_plan_phase (
record_id serial unique,
- phase_number tinyint(3) unsigned NOT NULL,
- phase_def_record_id bigint unsigned not null,
- target_plan_def_record_id bigint unsigned not null,
+ phase_number tinyint(3) /*! unsigned */ NOT NULL,
+ phase_def_record_id bigint /*! unsigned */ not null,
+ target_plan_def_record_id bigint /*! unsigned */ not null,
created_date datetime NOT NULL,
created_by varchar(50) NOT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX catalog_override_plan_phase_idx ON catalog_override_plan_phase(tenant_record_id, phase_number, phase_def_record_id);
diff --git a/entitlement/src/main/resources/org/killbill/billing/entitlement/ddl.sql b/entitlement/src/main/resources/org/killbill/billing/entitlement/ddl.sql
index 661a4d4..960a364 100644
--- a/entitlement/src/main/resources/org/killbill/billing/entitlement/ddl.sql
+++ b/entitlement/src/main/resources/org/killbill/billing/entitlement/ddl.sql
@@ -17,8 +17,8 @@ CREATE TABLE blocking_states (
created_by varchar(50) NOT NULL,
updated_date datetime DEFAULT NULL,
updated_by varchar(50) DEFAULT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX blocking_states_id ON blocking_states(blockable_id);
diff --git a/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql b/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql
index 8985ac8..1caf4a3 100644
--- a/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql
+++ b/invoice/src/main/resources/org/killbill/billing/invoice/ddl.sql
@@ -21,8 +21,8 @@ CREATE TABLE invoice_items (
linked_item_id char(36),
created_by varchar(50) NOT NULL,
created_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX invoice_items_id ON invoice_items(id);
@@ -42,8 +42,8 @@ CREATE TABLE invoices (
migrated bool NOT NULL,
created_by varchar(50) NOT NULL,
created_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX invoices_id ON invoices(id);
@@ -65,8 +65,8 @@ CREATE TABLE invoice_payments (
linked_invoice_payment_id char(36) DEFAULT NULL,
created_by varchar(50) NOT NULL,
created_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX invoice_payments_id ON invoice_payments(id);
diff --git a/payment/src/main/resources/org/killbill/billing/payment/ddl.sql b/payment/src/main/resources/org/killbill/billing/payment/ddl.sql
index 85f0e94..182da08 100644
--- a/payment/src/main/resources/org/killbill/billing/payment/ddl.sql
+++ b/payment/src/main/resources/org/killbill/billing/payment/ddl.sql
@@ -19,8 +19,8 @@ CREATE TABLE payment_attempts (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY (record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX payment_attempts_id ON payment_attempts(id);
@@ -34,7 +34,7 @@ DROP TABLE IF EXISTS payment_attempt_history;
CREATE TABLE payment_attempt_history (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
account_id char(36) NOT NULL,
payment_method_id char(36) DEFAULT NULL,
payment_external_key char(128) NOT NULL,
@@ -51,8 +51,8 @@ CREATE TABLE payment_attempt_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX payment_attempt_history_target_record_id ON payment_attempt_history(target_record_id);
@@ -70,8 +70,8 @@ CREATE TABLE payment_methods (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY (record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX payment_methods_id ON payment_methods(id);
@@ -85,7 +85,7 @@ CREATE TABLE payment_method_history (
record_id serial unique,
id char(36) NOT NULL,
external_key varchar(255) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
account_id char(36) NOT NULL,
plugin_name varchar(50) NOT NULL,
is_active bool DEFAULT true,
@@ -94,8 +94,8 @@ CREATE TABLE payment_method_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX payment_method_history_target_record_id ON payment_method_history(target_record_id);
@@ -115,8 +115,8 @@ CREATE TABLE payments (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY (record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX payments_id ON payments(id);
@@ -129,7 +129,7 @@ DROP TABLE IF EXISTS payment_history;
CREATE TABLE payment_history (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
account_id char(36) NOT NULL,
payment_method_id char(36) NOT NULL,
external_key varchar(255) NOT NULL,
@@ -140,8 +140,8 @@ CREATE TABLE payment_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX payment_history_target_record_id ON payment_history(target_record_id);
@@ -168,8 +168,8 @@ CREATE TABLE payment_transactions (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY (record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX transactions_id ON payment_transactions(id);
@@ -184,7 +184,7 @@ CREATE TABLE payment_transaction_history (
id char(36) NOT NULL,
attempt_id char(36) DEFAULT NULL,
transaction_external_key varchar(255) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
transaction_type varchar(32) NOT NULL,
effective_date datetime NOT NULL,
transaction_status varchar(50) NOT NULL,
@@ -200,8 +200,8 @@ CREATE TABLE payment_transaction_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY (record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX transaction_history_target_record_id ON payment_transaction_history(target_record_id);
diff --git a/subscription/src/main/resources/org/killbill/billing/subscription/ddl.sql b/subscription/src/main/resources/org/killbill/billing/subscription/ddl.sql
index 6941c04..d560d34 100644
--- a/subscription/src/main/resources/org/killbill/billing/subscription/ddl.sql
+++ b/subscription/src/main/resources/org/killbill/billing/subscription/ddl.sql
@@ -18,8 +18,8 @@ CREATE TABLE subscription_events (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX subscription_events_id ON subscription_events(id);
@@ -41,8 +41,8 @@ CREATE TABLE subscriptions (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX subscriptions_id ON subscriptions(id);
@@ -61,8 +61,8 @@ CREATE TABLE bundles (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX bundles_id ON bundles(id);
diff --git a/tenant/src/main/resources/org/killbill/billing/tenant/ddl.sql b/tenant/src/main/resources/org/killbill/billing/tenant/ddl.sql
index d1755c5..9cd149f 100644
--- a/tenant/src/main/resources/org/killbill/billing/tenant/ddl.sql
+++ b/tenant/src/main/resources/org/killbill/billing/tenant/ddl.sql
@@ -22,7 +22,7 @@ DROP TABLE IF EXISTS tenant_kvs;
CREATE TABLE tenant_kvs (
record_id serial unique,
id char(36) NOT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
tenant_key varchar(255) NOT NULL,
tenant_value mediumtext NOT NULL,
is_active bool DEFAULT 1,
@@ -39,9 +39,9 @@ DROP TABLE IF EXISTS tenant_broadcasts;
CREATE TABLE tenant_broadcasts (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
target_table_name varchar(50) NOT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
type varchar(64) NOT NULL,
user_token char(36),
created_date datetime NOT NULL,
diff --git a/usage/src/main/resources/org/killbill/billing/usage/ddl.sql b/usage/src/main/resources/org/killbill/billing/usage/ddl.sql
index d8123c5..30541f6 100644
--- a/usage/src/main/resources/org/killbill/billing/usage/ddl.sql
+++ b/usage/src/main/resources/org/killbill/billing/usage/ddl.sql
@@ -10,8 +10,8 @@ CREATE TABLE rolled_up_usage (
amount bigint NOT NULL,
created_by varchar(50) NOT NULL,
created_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX rolled_up_usage_id ON rolled_up_usage(id);
diff --git a/util/src/main/resources/cleanAccount.sql b/util/src/main/resources/cleanAccount.sql
index 0ec45f0..ceb8bd4 100644
--- a/util/src/main/resources/cleanAccount.sql
+++ b/util/src/main/resources/cleanAccount.sql
@@ -3,8 +3,8 @@ DELIMITER //
CREATE PROCEDURE cleanAccount(p_account_key char(36))
BEGIN
- DECLARE v_account_record_id int(11) unsigned;
-
+ DECLARE v_account_record_id int(11) /*! unsigned */;
+
select record_id from accounts WHERE external_key = p_account_key into v_account_record_id;
DELETE FROM analytics_account_fields WHERE account_record_id = v_account_record_id;
diff --git a/util/src/main/resources/org/killbill/billing/util/ddl.sql b/util/src/main/resources/org/killbill/billing/util/ddl.sql
index 4fd421d..4962d59 100644
--- a/util/src/main/resources/org/killbill/billing/util/ddl.sql
+++ b/util/src/main/resources/org/killbill/billing/util/ddl.sql
@@ -13,8 +13,8 @@ CREATE TABLE custom_fields (
created_date datetime NOT NULL,
updated_by varchar(50) DEFAULT NULL,
updated_date datetime DEFAULT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX custom_fields_id ON custom_fields(id);
@@ -25,7 +25,7 @@ DROP TABLE IF EXISTS custom_field_history;
CREATE TABLE custom_field_history (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
object_id char(36) NOT NULL,
object_type varchar(30) NOT NULL,
is_active bool DEFAULT true,
@@ -36,8 +36,8 @@ CREATE TABLE custom_field_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX custom_field_history_target_record_id ON custom_field_history(target_record_id);
@@ -55,7 +55,7 @@ CREATE TABLE tag_definitions (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- tenant_record_id bigint unsigned not null default 0,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX tag_definitions_id ON tag_definitions(id);
@@ -65,7 +65,7 @@ DROP TABLE IF EXISTS tag_definition_history;
CREATE TABLE tag_definition_history (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
name varchar(30) NOT NULL,
description varchar(200),
is_active bool DEFAULT true,
@@ -74,8 +74,8 @@ CREATE TABLE tag_definition_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX tag_definition_history_id ON tag_definition_history(id);
@@ -95,8 +95,8 @@ CREATE TABLE tags (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX tags_id ON tags(id);
@@ -107,7 +107,7 @@ DROP TABLE IF EXISTS tag_history;
CREATE TABLE tag_history (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
object_id char(36) NOT NULL,
object_type varchar(30) NOT NULL,
tag_definition_id char(36) NOT NULL,
@@ -117,8 +117,8 @@ CREATE TABLE tag_history (
created_date datetime NOT NULL,
updated_by varchar(50) NOT NULL,
updated_date datetime NOT NULL,
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX tag_history_target_record_id ON tag_history(target_record_id);
@@ -129,7 +129,7 @@ DROP TABLE IF EXISTS audit_log;
CREATE TABLE audit_log (
record_id serial unique,
id char(36) NOT NULL,
- target_record_id bigint unsigned not null,
+ target_record_id bigint /*! unsigned */ not null,
table_name varchar(50) NOT NULL,
change_type char(6) NOT NULL,
created_date datetime NOT NULL,
@@ -137,8 +137,8 @@ CREATE TABLE audit_log (
reason_code varchar(255) DEFAULT NULL,
comments varchar(255) DEFAULT NULL,
user_token char(36),
- account_record_id bigint unsigned not null,
- tenant_record_id bigint unsigned not null default 0,
+ account_record_id bigint /*! unsigned */ not null,
+ tenant_record_id bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX audit_log_fetch_target_record_id ON audit_log(table_name, target_record_id);
@@ -159,9 +159,9 @@ CREATE TABLE notifications (
processing_owner char(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
- error_count int(11) unsigned DEFAULT 0,
- search_key1 bigint unsigned not null,
- search_key2 bigint unsigned not null default 0,
+ error_count int(11) /*! unsigned */ DEFAULT 0,
+ search_key1 bigint /*! unsigned */ not null,
+ search_key2 bigint /*! unsigned */ not null default 0,
queue_name char(64) NOT NULL,
effective_date datetime NOT NULL,
future_user_token char(36),
@@ -183,9 +183,9 @@ CREATE TABLE notifications_history (
processing_owner char(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
- error_count int(11) unsigned DEFAULT 0,
- search_key1 bigint unsigned not null,
- search_key2 bigint unsigned not null default 0,
+ error_count int(11) /*! unsigned */ DEFAULT 0,
+ search_key1 bigint /*! unsigned */ not null,
+ search_key2 bigint /*! unsigned */ not null default 0,
queue_name char(64) NOT NULL,
effective_date datetime NOT NULL,
future_user_token char(36),
@@ -203,9 +203,9 @@ CREATE TABLE bus_events (
processing_owner char(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
- error_count int(11) unsigned DEFAULT 0,
- search_key1 bigint unsigned not null,
- search_key2 bigint unsigned not null default 0,
+ error_count int(11) /*! unsigned */ DEFAULT 0,
+ search_key1 bigint /*! unsigned */ not null,
+ search_key2 bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX `idx_bus_where` ON bus_events (`processing_state`,`processing_owner`,`processing_available_date`);
@@ -222,9 +222,9 @@ CREATE TABLE bus_events_history (
processing_owner char(50) DEFAULT NULL,
processing_available_date datetime DEFAULT NULL,
processing_state varchar(14) DEFAULT 'AVAILABLE',
- error_count int(11) unsigned DEFAULT 0,
- search_key1 bigint unsigned not null,
- search_key2 bigint unsigned not null default 0,
+ error_count int(11) /*! unsigned */ DEFAULT 0,
+ search_key1 bigint /*! unsigned */ not null,
+ search_key2 bigint /*! unsigned */ not null default 0,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
diff --git a/util/src/test/java/org/killbill/billing/DBTestingHelper.java b/util/src/test/java/org/killbill/billing/DBTestingHelper.java
index 670eaa1..cd9c246 100644
--- a/util/src/test/java/org/killbill/billing/DBTestingHelper.java
+++ b/util/src/test/java/org/killbill/billing/DBTestingHelper.java
@@ -59,7 +59,7 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
// We always want the accounts and tenants table
instance.executeScript("drop table if exists accounts;" +
"CREATE TABLE accounts (\n" +
- " record_id int(11) unsigned NOT NULL AUTO_INCREMENT,\n" +
+ " record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,\n" +
" id char(36) NOT NULL,\n" +
" external_key varchar(128) NULL,\n" +
" email varchar(128) NOT NULL,\n" +
@@ -85,12 +85,12 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
" created_by varchar(50) NOT NULL,\n" +
" updated_date datetime DEFAULT NULL,\n" +
" updated_by varchar(50) DEFAULT NULL,\n" +
- " tenant_record_id int(11) unsigned default null,\n" +
+ " tenant_record_id int(11) /*! unsigned */ default null,\n" +
" PRIMARY KEY(record_id)\n" +
");");
instance.executeScript("DROP TABLE IF EXISTS tenants;\n" +
"CREATE TABLE tenants (\n" +
- " record_id int(11) unsigned NOT NULL AUTO_INCREMENT,\n" +
+ " record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,\n" +
" id char(36) NOT NULL,\n" +
" external_key varchar(128) NULL,\n" +
" api_key varchar(128) NULL,\n" +
@@ -106,7 +106,7 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
// We always want the basic tables when we do account_record_id lookups (e.g. for custom fields, tags or junction)
instance.executeScript("DROP TABLE IF EXISTS bundles;\n" +
"CREATE TABLE bundles (\n" +
- " record_id int(11) unsigned NOT NULL AUTO_INCREMENT,\n" +
+ " record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,\n" +
" id char(36) NOT NULL,\n" +
" external_key varchar(64) NOT NULL,\n" +
" account_id char(36) NOT NULL,\n" +
@@ -115,13 +115,13 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
" created_date datetime NOT NULL,\n" +
" updated_by varchar(50) NOT NULL,\n" +
" updated_date datetime NOT NULL,\n" +
- " account_record_id int(11) unsigned default null,\n" +
- " tenant_record_id int(11) unsigned default null,\n" +
+ " account_record_id int(11) /*! unsigned */ default null,\n" +
+ " tenant_record_id int(11) /*! unsigned */ default null,\n" +
" PRIMARY KEY(record_id)\n" +
");");
instance.executeScript("DROP TABLE IF EXISTS subscriptions;\n" +
"CREATE TABLE subscriptions (\n" +
- " record_id int(11) unsigned NOT NULL AUTO_INCREMENT,\n" +
+ " record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,\n" +
" id char(36) NOT NULL,\n" +
" bundle_id char(36) NOT NULL,\n" +
" category varchar(32) NOT NULL,\n" +
@@ -134,15 +134,15 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
" created_date datetime NOT NULL,\n" +
" updated_by varchar(50) NOT NULL,\n" +
" updated_date datetime NOT NULL,\n" +
- " account_record_id int(11) unsigned default null,\n" +
- " tenant_record_id int(11) unsigned default null,\n" +
+ " account_record_id int(11) /*! unsigned */ default null,\n" +
+ " tenant_record_id int(11) /*! unsigned */ default null,\n" +
" PRIMARY KEY(record_id)\n" +
");");
// HACK (PIERRE): required by invoice tests which perform payments lookups to find the account record id for the internal callcontext
instance.executeScript("DROP TABLE IF EXISTS payments;\n" +
"CREATE TABLE payments (\n" +
- " record_id int(11) unsigned NOT NULL AUTO_INCREMENT,\n" +
+ " record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,\n" +
" id char(36) NOT NULL,\n" +
" account_id char(36) NOT NULL,\n" +
" invoice_id char(36) NOT NULL,\n" +
@@ -155,8 +155,8 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
" created_date datetime NOT NULL,\n" +
" updated_by varchar(50) NOT NULL,\n" +
" updated_date datetime NOT NULL,\n" +
- " account_record_id int(11) unsigned default null,\n" +
- " tenant_record_id int(11) unsigned default null,\n" +
+ " account_record_id int(11) /*! unsigned */ default null,\n" +
+ " tenant_record_id int(11) /*! unsigned */ default null,\n" +
" PRIMARY KEY (record_id)\n" +
");");
diff --git a/util/src/test/java/org/killbill/billing/util/callcontext/TestInternalCallContextFactory.java b/util/src/test/java/org/killbill/billing/util/callcontext/TestInternalCallContextFactory.java
index 3b863a5..6e0eba4 100644
--- a/util/src/test/java/org/killbill/billing/util/callcontext/TestInternalCallContextFactory.java
+++ b/util/src/test/java/org/killbill/billing/util/callcontext/TestInternalCallContextFactory.java
@@ -41,7 +41,7 @@ public class TestInternalCallContextFactory extends UtilTestSuiteWithEmbeddedDB
public Void withHandle(final Handle handle) throws Exception {
handle.execute("DROP TABLE IF EXISTS invoices;\n" +
"CREATE TABLE invoices (\n" +
- " record_id int(11) unsigned NOT NULL AUTO_INCREMENT,\n" +
+ " record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,\n" +
" id char(36) NOT NULL,\n" +
" account_id char(36) NOT NULL,\n" +
" invoice_date date NOT NULL,\n" +
@@ -50,8 +50,8 @@ public class TestInternalCallContextFactory extends UtilTestSuiteWithEmbeddedDB
" migrated bool NOT NULL,\n" +
" created_by varchar(50) NOT NULL,\n" +
" created_date datetime NOT NULL,\n" +
- " account_record_id int(11) unsigned default null,\n" +
- " tenant_record_id int(11) unsigned default null,\n" +
+ " account_record_id int(11) /*! unsigned */ default null,\n" +
+ " tenant_record_id int(11) /*! unsigned */ default null,\n" +
" PRIMARY KEY(record_id)\n" +
");");
handle.execute("insert into invoices (id, account_id, invoice_date, target_date, currency, migrated, created_by, created_date, account_record_id) values " +
diff --git a/util/src/test/java/org/killbill/billing/util/export/dao/TestDatabaseExportDao.java b/util/src/test/java/org/killbill/billing/util/export/dao/TestDatabaseExportDao.java
index 5abfe1a..0483a20 100644
--- a/util/src/test/java/org/killbill/billing/util/export/dao/TestDatabaseExportDao.java
+++ b/util/src/test/java/org/killbill/billing/util/export/dao/TestDatabaseExportDao.java
@@ -54,16 +54,16 @@ public class TestDatabaseExportDao extends UtilTestSuiteWithEmbeddedDB {
@Override
public Void withHandle(final Handle handle) throws Exception {
handle.execute("drop table if exists " + tableNameA);
- handle.execute("create table " + tableNameA + "(record_id int(11) unsigned not null auto_increment," +
+ handle.execute("create table " + tableNameA + "(record_id int(11) /*! unsigned */ not null auto_increment," +
"a_column char default 'a'," +
- "account_record_id int(11) unsigned not null," +
- "tenant_record_id int(11) unsigned default 0," +
+ "account_record_id int(11) /*! unsigned */ not null," +
+ "tenant_record_id int(11) /*! unsigned */ default 0," +
"primary key(record_id));");
handle.execute("drop table if exists " + tableNameB);
- handle.execute("create table " + tableNameB + "(record_id int(11) unsigned not null auto_increment," +
+ handle.execute("create table " + tableNameB + "(record_id int(11) /*! unsigned */ not null auto_increment," +
"b_column char default 'b'," +
- "account_record_id int(11) unsigned not null," +
- "tenant_record_id int(11) unsigned default 0," +
+ "account_record_id int(11) /*! unsigned */ not null," +
+ "tenant_record_id int(11) /*! unsigned */ default 0," +
"primary key(record_id));");
handle.execute("insert into " + tableNameA + " (account_record_id, tenant_record_id) values (?, ?)",
internalCallContext.getAccountRecordId(), internalCallContext.getTenantRecordId());
diff --git a/util/src/test/resources/org/killbill/billing/util/ddl_test.sql b/util/src/test/resources/org/killbill/billing/util/ddl_test.sql
index 8f96014..0f6aa57 100644
--- a/util/src/test/resources/org/killbill/billing/util/ddl_test.sql
+++ b/util/src/test/resources/org/killbill/billing/util/ddl_test.sql
@@ -9,7 +9,7 @@ CREATE TABLE dummy (
DROP TABLE IF EXISTS dummy2;
CREATE TABLE dummy2 (
- id int(11) unsigned NOT NULL AUTO_INCREMENT,
+ id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,
dummy_id char(36) NOT NULL,
PRIMARY KEY(id)
);
@@ -24,19 +24,19 @@ CREATE TABLE validation_test (
DROP TABLE IF EXISTS kombucha;
CREATE TABLE kombucha (
- record_id int(11) unsigned NOT NULL AUTO_INCREMENT,
+ record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,
id char(36) NOT NULL,
tea varchar(50) NOT NULL,
mushroom varchar(50) NOT NULL,
sugar varchar(50) NOT NULL,
- account_record_id int(11) unsigned default null,
- tenant_record_id int(11) unsigned default null,
+ account_record_id int(11) /*! unsigned */ default null,
+ tenant_record_id int(11) /*! unsigned */ default null,
PRIMARY KEY(record_id)
);
DROP TABLE IF EXISTS full_of_dates;
CREATE TABLE full_of_dates (
- record_id int(11) unsigned NOT NULL AUTO_INCREMENT,
+ record_id int(11) /*! unsigned */ NOT NULL AUTO_INCREMENT,
date1 date default NULL,
datetime1 datetime default NULL,
timestamp1 timestamp,