Permalink
Switch branches/tags
killbill-0.20.2 killbill-0.20.1 killbill-0.20.0 killbill-0.19.19 killbill-0.19.18 killbill-0.19.17 killbill-0.19.16 killbill-0.19.15 killbill-0.19.14 killbill-0.19.13 killbill-0.19.12 killbill-0.19.11 killbill-0.19.10 killbill-0.19.9 killbill-0.19.8 killbill-0.19.7 killbill-0.19.6 killbill-0.19.5 killbill-0.19.4 killbill-0.19.3 killbill-0.19.2 killbill-0.19.1 killbill-0.19.0 killbill-0.18.22 killbill-0.18.21 killbill-0.18.20 killbill-0.18.19 killbill-0.18.18 killbill-0.18.17 killbill-0.18.16 killbill-0.18.15 killbill-0.18.14 killbill-0.18.13 killbill-0.18.12 killbill-0.18.11 killbill-0.18.10 killbill-0.18.9 killbill-0.18.8 killbill-0.18.7 killbill-0.18.6 killbill-0.18.5 killbill-0.18.4 killbill-0.18.3 killbill-0.18.2 killbill-0.18.1 killbill-0.18.0 killbill-0.17.8 killbill-0.17.7 killbill-0.17.6 killbill-0.17.5 killbill-0.17.4 killbill-0.17.3 killbill-0.17.2.4 killbill-0.17.2.3 killbill-0.17.2.2 killbill-0.17.2.1 killbill-0.17.2 killbill-0.17.1 killbill-0.17.0 killbill-0.16.12 killbill-0.16.11 killbill-0.16.10 killbill-0.16.9 killbill-0.16.8 killbill-0.16.7 killbill-0.16.6 killbill-0.16.5 killbill-0.16.4 killbill-0.16.3 killbill-0.16.2 killbill-0.16.1 killbill-0.16.0 killbill-0.15.10 killbill-0.15.9 killbill-0.15.8 killbill-0.15.7 killbill-0.15.6 killbill-0.15.5 killbill-0.15.4 killbill-0.15.3 killbill-0.15.2 killbill-0.15.1 killbill-0.15.0 killbill-0.14.1 killbill-0.14.0 killbill-0.13.7 killbill-0.13.6 killbill-0.13.5 killbill-0.13.4 killbill-0.13.3 killbill-0.13.2 killbill-0.13.1 killbill-0.12.1 killbill-0.12.0 killbill-0.11.13 killbill-0.11.12 killbill-0.11.11 killbill-0.11.10 killbill-0.11.9 killbill-0.11.8
Nothing to show
Find file Copy path
121 lines (115 sloc) 5.03 KB
/*! SET default_storage_engine=INNODB */;
DROP TABLE IF EXISTS accounts;
CREATE TABLE accounts (
record_id serial unique,
id varchar(36) NOT NULL,
external_key varchar(255) NOT NULL,
email varchar(128) DEFAULT NULL,
name varchar(100) DEFAULT NULL,
first_name_length int DEFAULT NULL,
currency varchar(3) DEFAULT NULL,
billing_cycle_day_local int DEFAULT NULL,
parent_account_id varchar(36) DEFAULT NULL,
is_payment_delegated_to_parent boolean DEFAULT FALSE,
payment_method_id varchar(36) DEFAULT NULL,
reference_time datetime NOT NULL,
time_zone varchar(50) NOT NULL,
locale varchar(5) DEFAULT NULL,
address1 varchar(100) DEFAULT NULL,
address2 varchar(100) DEFAULT NULL,
company_name varchar(50) DEFAULT NULL,
city varchar(50) DEFAULT NULL,
state_or_province varchar(50) DEFAULT NULL,
country varchar(50) DEFAULT NULL,
postal_code varchar(16) DEFAULT NULL,
phone varchar(25) DEFAULT NULL,
notes varchar(4096) DEFAULT NULL,
migrated boolean default false,
created_date datetime NOT NULL,
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,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX accounts_id ON accounts(id);
CREATE UNIQUE INDEX accounts_external_key ON accounts(external_key, tenant_record_id);
CREATE INDEX accounts_parents ON accounts(parent_account_id);
CREATE INDEX accounts_tenant_record_id ON accounts(tenant_record_id);
CREATE INDEX accounts_email_tenant_record_id ON accounts(email, tenant_record_id);
CREATE INDEX accounts_company_name_tenant_record_id ON accounts(company_name, tenant_record_id);
CREATE INDEX accounts_name_tenant_record_id ON accounts(name, tenant_record_id);
DROP TABLE IF EXISTS account_history;
CREATE TABLE account_history (
record_id serial unique,
id varchar(36) NOT NULL,
target_record_id bigint /*! unsigned */ not null,
external_key varchar(255) NOT NULL,
email varchar(128) DEFAULT NULL,
name varchar(100) DEFAULT NULL,
first_name_length int DEFAULT NULL,
currency varchar(3) DEFAULT NULL,
billing_cycle_day_local int DEFAULT NULL,
parent_account_id varchar(36) DEFAULT NULL,
is_payment_delegated_to_parent boolean default false,
payment_method_id varchar(36) DEFAULT NULL,
reference_time datetime NOT NULL,
time_zone varchar(50) NOT NULL,
locale varchar(5) DEFAULT NULL,
address1 varchar(100) DEFAULT NULL,
address2 varchar(100) DEFAULT NULL,
company_name varchar(50) DEFAULT NULL,
city varchar(50) DEFAULT NULL,
state_or_province varchar(50) DEFAULT NULL,
country varchar(50) DEFAULT NULL,
postal_code varchar(16) DEFAULT NULL,
phone varchar(25) DEFAULT NULL,
notes varchar(4096) DEFAULT NULL,
migrated boolean default false,
change_type varchar(6) NOT NULL,
created_by varchar(50) NOT NULL,
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,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX account_history_target_record_id ON account_history(target_record_id);
CREATE INDEX account_history_tenant_record_id ON account_history(tenant_record_id);
DROP TABLE IF EXISTS account_emails;
CREATE TABLE account_emails (
record_id serial unique,
id varchar(36) NOT NULL,
account_id varchar(36) NOT NULL,
email varchar(128) NOT NULL,
is_active boolean default true,
created_by varchar(50) NOT NULL,
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,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE UNIQUE INDEX account_email_id ON account_emails(id);
CREATE INDEX account_email_account_id_email ON account_emails(account_id, email);
CREATE INDEX account_emails_tenant_account_record_id ON account_emails(tenant_record_id, account_record_id);
DROP TABLE IF EXISTS account_email_history;
CREATE TABLE account_email_history (
record_id serial unique,
id varchar(36) NOT NULL,
target_record_id bigint /*! unsigned */ not null,
account_id varchar(36) NOT NULL,
email varchar(128) NOT NULL,
is_active boolean default true,
change_type varchar(6) NOT NULL,
created_by varchar(50) NOT NULL,
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,
PRIMARY KEY(record_id)
) /*! CHARACTER SET utf8 COLLATE utf8_bin */;
CREATE INDEX account_email_target_record_id ON account_email_history(target_record_id);
CREATE INDEX account_email_history_tenant_account_record_id ON account_email_history(tenant_record_id, account_record_id);