killbill-uncached

util: fix local tests on MySQL, pass 2 The hardcoded schema

9/22/2017 7:36:20 AM

Details

diff --git a/util/src/test/java/org/killbill/billing/DBTestingHelper.java b/util/src/test/java/org/killbill/billing/DBTestingHelper.java
index 7046879..46a0907 100644
--- a/util/src/test/java/org/killbill/billing/DBTestingHelper.java
+++ b/util/src/test/java/org/killbill/billing/DBTestingHelper.java
@@ -79,14 +79,16 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
                                "CREATE TABLE accounts (\n" +
                                "    record_id serial unique,\n" +
                                "    id varchar(36) NOT NULL,\n" +
-                               "    external_key varchar(128) NULL,\n" +
-                               "    email varchar(128) NOT NULL,\n" +
-                               "    name varchar(100) NOT NULL,\n" +
-                               "    first_name_length int NOT NULL,\n" +
+                               "    external_key varchar(255) NULL,\n" +
+                               "    email varchar(128) DEFAULT NULL,\n" +
+                               "    name varchar(100) DEFAULT NULL,\n" +
+                               "    first_name_length int DEFAULT NULL,\n" +
                                "    currency varchar(3) DEFAULT NULL,\n" +
                                "    billing_cycle_day_local int DEFAULT NULL,\n" +
+                               "    parent_account_id varchar(36) DEFAULT NULL,\n" +
+                               "    is_payment_delegated_to_parent boolean DEFAULT FALSE,\n" +
                                "    payment_method_id varchar(36) DEFAULT NULL,\n" +
-                               "    time_zone varchar(50) DEFAULT NULL,\n" +
+                               "    time_zone varchar(50) NOT NULL,\n" +
                                "    locale varchar(5) DEFAULT NULL,\n" +
                                "    address1 varchar(100) DEFAULT NULL,\n" +
                                "    address2 varchar(100) DEFAULT NULL,\n" +
@@ -96,6 +98,7 @@ public class DBTestingHelper extends PlatformDBTestingHelper {
                                "    country varchar(50) DEFAULT NULL,\n" +
                                "    postal_code varchar(16) DEFAULT NULL,\n" +
                                "    phone varchar(25) DEFAULT NULL,\n" +
+                               "    notes varchar(4096) DEFAULT NULL,\n" +
                                "    migrated boolean default false,\n" +
                                "    is_notified_for_invoices boolean NOT NULL,\n" +
                                "    created_date datetime NOT NULL,\n" +
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 5763350..8c26cbe 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
@@ -87,8 +87,8 @@ public class TestDatabaseExportDao extends UtilTestSuiteWithEmbeddedDB {
 
         // Verify new dump
         final String newDump = getDump();
-        Assert.assertEquals(newDump, "-- accounts record_id|id|external_key|email|name|first_name_length|currency|billing_cycle_day_local|payment_method_id|time_zone|locale|address1|address2|company_name|city|state_or_province|country|postal_code|phone|migrated|is_notified_for_invoices|created_date|created_by|updated_date|updated_by|tenant_record_id\n" +
-                                     String.format("%s|%s||%s|%s|%s||||%s||||||||||false|%s|%s|%s|%s|%s|%s", internalCallContext.getAccountRecordId(), accountId, accountEmail, accountName, firstNameLength, timeZone,
+        Assert.assertEquals(newDump, "-- accounts record_id|id|external_key|email|name|first_name_length|currency|billing_cycle_day_local|parent_account_id|is_payment_delegated_to_parent|payment_method_id|time_zone|locale|address1|address2|company_name|city|state_or_province|country|postal_code|phone|notes|migrated|is_notified_for_invoices|created_date|created_by|updated_date|updated_by|tenant_record_id\n" +
+                                     String.format("%s|%s||%s|%s|%s||||false||%s|||||||||||false|%s|%s|%s|%s|%s|%s", internalCallContext.getAccountRecordId(), accountId, accountEmail, accountName, firstNameLength, timeZone,
                                                    isNotifiedForInvoices, "1970-05-24T18:33:02.000+0000", createdBy, "1982-02-18T20:03:42.000+0000", updatedBy, internalCallContext.getTenantRecordId()) + "\n" +
                                      "-- " + tableNameA + " record_id|a_column|blob_column|account_record_id|tenant_record_id\n" +
                                      "1|a|WlYAAARjYWZl|" + internalCallContext.getAccountRecordId() + "|" + internalCallContext.getTenantRecordId() + "\n" +