SuccessConsole Output

Established TCP socket on 42039
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/pom.xml clean deploy -Durl=file:///var/www/maven
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< org.dataone:bookkeeper >-----------------------
[INFO] Building bookkeeper 0.1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ bookkeeper ---
[INFO] Deleting /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ bookkeeper ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 18 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ bookkeeper ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 41 source files to /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes
[INFO] /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/src/main/java/org/dataone/bookkeeper/resources/QuotasResource.java: Some input files use unchecked or unsafe operations.
[INFO] /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/src/main/java/org/dataone/bookkeeper/resources/QuotasResource.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ bookkeeper ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 9 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ bookkeeper ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 24 source files to /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.0:test (default-test) @ bookkeeper ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.dataone.bookkeeper.api.OrderTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.435 s - in org.dataone.bookkeeper.api.OrderTest
[INFO] Running org.dataone.bookkeeper.api.ProductTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s - in org.dataone.bookkeeper.api.ProductTest
[INFO] Running org.dataone.bookkeeper.api.AddressTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in org.dataone.bookkeeper.api.AddressTest
[INFO] Running org.dataone.bookkeeper.api.UsageTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 s - in org.dataone.bookkeeper.api.UsageTest
[INFO] Running org.dataone.bookkeeper.api.FeatureTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 s - in org.dataone.bookkeeper.api.FeatureTest
[INFO] Running org.dataone.bookkeeper.api.CustomerTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.028 s - in org.dataone.bookkeeper.api.CustomerTest
[INFO] Running org.dataone.bookkeeper.api.OrderItemTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in org.dataone.bookkeeper.api.OrderItemTest
[INFO] Running org.dataone.bookkeeper.api.QuotaTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s - in org.dataone.bookkeeper.api.QuotaTest
[INFO] Running org.dataone.bookkeeper.api.UsageStatusTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in org.dataone.bookkeeper.api.UsageStatusTest
[INFO] Running org.dataone.bookkeeper.jdbi.MembershipStoreTest
04:18:55.441 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - Detected a Linux x86_64 system
04:18:55.512 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - Postgres binaries at /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - The files belonging to this database system will be owned by user "jenkins".
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - This user must also own the server process.
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - 
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - The database cluster will be initialized with locale "en_US.UTF-8".
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - The default text search configuration will be set to "english".
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - 
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - Data page checksums are disabled.
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - 
04:18:55.524 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - fixing permissions on existing directory /tmp/epg8911945613447231025 ... ok
04:18:55.525 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - creating subdirectories ... ok
04:18:55.561 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - selecting default max_connections ... 100
04:18:55.578 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - selecting default shared_buffers ... 128MB
04:18:55.578 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - selecting dynamic shared memory implementation ... posix
04:18:55.649 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - creating configuration files ... ok
04:18:55.742 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - running bootstrap script ... ok
04:18:56.124 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - performing post-bootstrap initialization ... ok
04:18:56.377 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - syncing data to disk ... ok
04:18:56.378 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - 
04:18:56.378 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - Success. You can now start the database server using:
04:18:56.378 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - 
04:18:56.378 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb -     /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca/bin/pg_ctl -D /tmp/epg8911945613447231025 -l logfile start
04:18:56.378 [log:pid(14681)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:initdb - 
04:18:56.378 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 721c8089-d117-4cdb-9567-bc441cb5759d initdb completed in 00:00:00.863
04:18:56.388 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 721c8089-d117-4cdb-9567-bc441cb5759d postmaster started as java.lang.UNIXProcess@23fb172e on port 5432.  Waiting up to PT10S for server startup to finish.
04:18:56.401 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d - waiting for server to start....2020-09-27 04:18:56.401 UTC [14699] LOG:  listening on IPv6 address "::1", port 5432
04:18:56.401 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d - 2020-09-27 04:18:56.401 UTC [14699] LOG:  listening on IPv4 address "127.0.0.1", port 5432
04:18:56.401 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d - 2020-09-27 04:18:56.401 UTC [14699] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
04:18:56.437 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d - 2020-09-27 04:18:56.437 UTC [14700] LOG:  database system was shut down at 2020-09-27 04:18:56 UTC
04:18:56.439 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d - 2020-09-27 04:18:56.439 UTC [14699] LOG:  database system is ready to accept connections
04:18:56.495 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d -  done
04:18:56.495 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d - server started
04:18:56.497 [log:pid(14695)] INFO pg-721c8089-d117-4cdb-9567-bc441cb5759d - 2020-09-27 04:18:56.497 UTC [14707] LOG:  incomplete startup packet
04:18:56.599 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 721c8089-d117-4cdb-9567-bc441cb5759d postmaster startup finished in 00:00:00.212
04:18:56.618 [main] INFO org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 5.2.4 by Boxfuse
04:18:56.631 [main] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.6)
04:18:56.632 [main] DEBUG org.flywaydb.core.internal.database.DatabaseFactory - Driver  : PostgreSQL JDBC Driver 42.2.6
04:18:56.636 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:18:56.640 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:18:56.644 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:18:56.644 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:18:56.644 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:18:56.645 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:18:56.646 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:18:56.646 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:18:56.648 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:18:56.649 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:18:56.649 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:18:56.649 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:18:56.649 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:18:56.649 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:18:56.649 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:18:56.652 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:18:56.655 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:18:56.662 [main] DEBUG org.flywaydb.core.internal.command.DbValidate - Validating migrations ...
04:18:56.666 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.0__Create_Bookkeeper_Database.sql ...
04:18:56.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.10__Create_Orders_Table.sql ...
04:18:56.672 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:18:56.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:18:56.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:18:56.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:18:56.676 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:18:56.676 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:18:56.676 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:18:56.677 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:18:56.677 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:18:56.678 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:18:56.678 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:18:56.678 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:18:56.678 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:18:56.679 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:18:56.679 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:18:56.679 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:18:56.680 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:18:56.680 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:18:56.680 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:18:56.681 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:18:56.681 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.11__Alter_Orders_Add_Customer_FK.sql ...
04:18:56.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:18:56.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.12__Create_Usages_Table.sql ...
04:18:56.684 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:18:56.685 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:18:56.685 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 16: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:18:56.686 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:18:56.686 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 19: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:18:56.686 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:18:56.686 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:18:56.687 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:18:56.687 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:18:56.687 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:18:56.687 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:18:56.688 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:18:56.688 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:18:56.688 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:18:56.689 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.13__Create_Function_Update_Quota_Table_Usage.sql ...
04:18:56.690 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:18:56.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 23: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:18:56.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:18:56.693 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:18:56.693 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:18:56.693 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:18:56.694 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.14__Alter_Usages_Add_Unique_Constraint.sql ...
04:18:56.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:18:56.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql ...
04:18:56.696 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:18:56.696 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.1__Create_Quotas_Table.sql ...
04:18:56.697 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:18:56.697 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:18:56.698 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:18:56.698 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 20: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:18:56.698 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:18:56.698 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 22: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:18:56.698 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:18:56.699 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:18:56.699 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:18:56.699 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:18:56.699 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:18:56.699 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:18:56.700 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:18:56.700 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:18:56.700 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:18:56.700 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:18:56.701 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.2__Insert_Standard_Quotas.sql ...
04:18:56.701 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:18:56.702 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:18:56.702 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 12: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:18:56.703 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.3__Create_Memberships_Table.sql ...
04:18:56.703 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:18:56.705 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:18:56.705 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:18:56.705 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:18:56.705 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:18:56.706 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:18:56.706 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:18:56.706 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:18:56.706 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:18:56.706 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:18:56.707 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:18:56.707 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:18:56.707 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:18:56.708 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:18:56.708 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 49: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:18:56.708 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:18:56.708 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 51: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:18:56.708 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 52: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:18:56.708 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 53: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:18:56.709 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.4__Alter_Quotas_Add_Membership_FK.sql ...
04:18:56.709 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:18:56.710 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.5__Create_Customers_Table.sql ...
04:18:56.710 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:18:56.711 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:18:56.712 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:18:56.712 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:18:56.712 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:18:56.712 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:18:56.712 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:18:56.713 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:18:56.713 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:18:56.713 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:18:56.713 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:18:56.713 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:18:56.714 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:18:56.714 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:18:56.714 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN customers.description IS 'The customer description'
04:18:56.714 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:18:56.714 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:18:56.715 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:18:56.715 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:18:56.715 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:18:56.715 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:18:56.715 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:18:56.716 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 47: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:18:56.716 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.6__Alter_Memberships_Add_Customer_FK.sql ...
04:18:56.717 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:18:56.717 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.7__Create_Products_Table.sql ...
04:18:56.718 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the products table
CREATE SEQUENCE products_id_seq
04:18:56.719 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:18:56.719 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:18:56.719 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX products_active_idx ON products USING btree(active)
04:18:56.720 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX products_name_idx ON products USING btree(name)
04:18:56.720 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:18:56.720 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: CREATE INDEX products_description_idx ON products USING btree(description)
04:18:56.720 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:18:56.720 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:18:56.721 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:18:56.721 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:18:56.721 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:18:56.721 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN products.name IS 'The product name.'
04:18:56.721 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:18:56.721 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:18:56.722 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN products.description IS 'The product general description.'
04:18:56.723 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:18:56.723 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:18:56.723 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:18:56.723 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:18:56.723 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:18:56.723 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:18:56.723 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:18:56.724 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.8__Insert_Standard_Products.sql ...
04:18:56.727 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.729 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.731 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.732 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 64: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.735 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 84: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:18:56.736 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 104: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:18:56.737 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.9__Alter_Memberships_Add_Product_FK.sql ...
04:18:56.738 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:18:56.738 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql (filename: V1.0__Create_Bookkeeper_Database.sql)
04:18:56.738 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.10__Create_Orders_Table.sql (filename: V1.10__Create_Orders_Table.sql)
04:18:56.738 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql (filename: V1.11__Alter_Orders_Add_Customer_FK.sql)
04:18:56.738 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.12__Create_Usages_Table.sql (filename: V1.12__Create_Usages_Table.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql (filename: V1.13__Create_Function_Update_Quota_Table_Usage.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql (filename: V1.14__Alter_Usages_Add_Unique_Constraint.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql (filename: V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.1__Create_Quotas_Table.sql (filename: V1.1__Create_Quotas_Table.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.2__Insert_Standard_Quotas.sql (filename: V1.2__Insert_Standard_Quotas.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.3__Create_Memberships_Table.sql (filename: V1.3__Create_Memberships_Table.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql (filename: V1.4__Alter_Quotas_Add_Membership_FK.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.5__Create_Customers_Table.sql (filename: V1.5__Create_Customers_Table.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql (filename: V1.6__Alter_Memberships_Add_Customer_FK.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.7__Create_Products_Table.sql (filename: V1.7__Create_Products_Table.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.8__Insert_Standard_Products.sql (filename: V1.8__Insert_Standard_Products.sql)
04:18:56.739 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql (filename: V1.9__Alter_Memberships_Add_Product_FK.sql)
04:18:56.748 [main] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 16 migrations (execution time 00:00.085s)
04:18:56.750 [main] DEBUG org.flywaydb.core.internal.command.DbSchemas - Schema "public" already exists. Skipping schema creation.
04:18:56.757 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table: "public"."flyway_schema_history"
04:18:56.758 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing createMetaDataTable.sql ...
04:18:56.759 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 17: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:18:56.759 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:18:56.759 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:18:56.759 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:18:56.763 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.763 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:18:56.764 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.764 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:18:56.765 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.765 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Created Schema History table: "public"."flyway_schema_history"
04:18:56.779 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
04:18:56.780 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.0 - Create Bookkeeper Database
04:18:56.781 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.0 - Create Bookkeeper Database
04:18:56.784 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.787 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.1 - Create Quotas Table
04:18:56.788 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:18:56.789 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.789 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:18:56.790 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.790 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:18:56.791 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.791 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:18:56.791 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.791 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:18:56.792 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.792 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:18:56.792 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.792 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:18:56.793 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.793 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:18:56.793 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.793 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:18:56.793 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.793 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:18:56.793 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.794 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:18:56.794 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.794 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:18:56.794 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.794 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:18:56.794 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.794 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:18:56.795 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.795 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:18:56.795 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.795 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:18:56.795 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.795 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.1 - Create Quotas Table
04:18:56.796 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.798 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.2 - Insert Standard Quotas
04:18:56.799 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:18:56.800 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.800 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:18:56.800 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.800 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:18:56.801 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.801 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.2 - Insert Standard Quotas
04:18:56.802 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.804 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.3 - Create Memberships Table
04:18:56.805 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:18:56.806 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.806 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:18:56.807 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.808 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:18:56.808 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.808 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:18:56.808 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.809 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:18:56.809 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.809 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:18:56.809 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.809 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.810 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.811 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.812 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:18:56.813 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.813 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.3 - Create Memberships Table
04:18:56.814 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.815 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:18:56.816 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:18:56.818 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.818 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:18:56.819 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.820 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.5 - Create Customers Table
04:18:56.821 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:18:56.822 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.822 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:18:56.823 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.823 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:18:56.823 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.823 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:18:56.824 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.824 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:18:56.824 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.824 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:18:56.824 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.824 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:18:56.825 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.826 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:18:56.826 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.826 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:18:56.826 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.826 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:18:56.826 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.826 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.description IS 'The customer description'
04:18:56.827 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.827 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:18:56.827 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.827 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:18:56.828 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.829 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:18:56.829 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.829 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:18:56.829 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.829 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.5 - Create Customers Table
04:18:56.830 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.832 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:18:56.832 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:18:56.833 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.833 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:18:56.834 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.836 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.7 - Create Products Table
04:18:56.836 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the products table
CREATE SEQUENCE products_id_seq
04:18:56.837 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.837 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:18:56.838 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.838 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:18:56.839 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.839 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_active_idx ON products USING btree(active)
04:18:56.839 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.839 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_name_idx ON products USING btree(name)
04:18:56.840 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.840 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:18:56.840 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.840 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_description_idx ON products USING btree(description)
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.841 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.name IS 'The product name.'
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.842 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.description IS 'The product general description.'
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.843 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.844 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.7 - Create Products Table
04:18:56.845 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.847 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.8 - Insert Standard Products
04:18:56.847 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.848 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.848 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.849 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.849 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.849 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.849 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:56.850 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.850 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:18:56.851 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.851 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:18:56.851 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:56.851 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.8 - Insert Standard Products
04:18:56.852 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.853 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.9 - Alter Memberships Add Product FK
04:18:56.854 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:18:56.855 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.855 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.9 - Alter Memberships Add Product FK
04:18:56.856 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.857 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.10 - Create Orders Table
04:18:56.858 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:18:56.859 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.859 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:18:56.860 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.860 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:18:56.861 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.861 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:18:56.861 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.861 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:18:56.862 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.862 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:18:56.862 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.862 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:18:56.862 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.862 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.863 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.864 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.865 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:18:56.866 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.866 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.10 - Create Orders Table
04:18:56.867 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.869 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.11 - Alter Orders Add Customer FK
04:18:56.869 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:18:56.870 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.870 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.11 - Alter Orders Add Customer FK
04:18:56.872 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.874 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.12 - Create Usages Table
04:18:56.875 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:18:56.875 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.875 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:18:56.876 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.876 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:18:56.877 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.877 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:18:56.877 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.877 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:18:56.878 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.878 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:18:56.879 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.879 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:18:56.879 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.879 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:18:56.879 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.879 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:18:56.880 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.880 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:18:56.880 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.880 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:18:56.880 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.880 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:18:56.881 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.881 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:18:56.881 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.881 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:18:56.881 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.881 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.12 - Create Usages Table
04:18:56.882 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.884 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:18:56.885 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:18:56.886 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.886 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:18:56.889 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_insert_or_update" for relation "usages" does not exist, skipping
04:18:56.889 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.889 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:18:56.889 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.889 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:18:56.890 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.890 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:18:56.890 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_delete" for relation "usages" does not exist, skipping
04:18:56.890 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.890 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:18:56.891 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.891 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:18:56.895 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.897 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:18:56.897 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:18:56.898 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.898 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:18:56.899 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.901 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:18:56.901 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:18:56.902 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:56.902 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:18:56.903 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:56.905 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 16 migrations to schema "public" (execution time 00:00.149s)
04:18:56.907 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 48 of 232M
04:18:56.938 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Log4jLoggerProvider
04:18:56.938 [main] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.1.0.Final
04:18:56.943 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable.
04:18:56.953 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.validation.valuehandling.GuavaOptionalValueExtractor@2ed3b1f5
04:18:56.953 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ConstraintValidatorFactory of type io.dropwizard.jersey.validation.MutableValidatorFactory
04:18:56.954 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ParameterNameProvider of type io.dropwizard.jersey.validation.JerseyParameterNameProvider
04:18:56.955 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.NonEmptyStringParamValueExtractor@4648ce9
04:18:56.956 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.ParamValueExtractor@76ba13c
04:18:56.958 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
04:18:56.959 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL
04:18:56.960 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader
04:18:56.960 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only.
04:18:56.977 [main] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL
04:18:57.051 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider.
04:18:57.056 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator.
04:18:57.056 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver.
04:18:57.056 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider.
04:18:57.056 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider.
04:18:57.056 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory.
04:18:57.080 [main] DEBUG org.eclipse.jetty.util.log - Logging to Logger[org.eclipse.jetty.util.log] via org.eclipse.jetty.util.log.Slf4jLog
04:18:57.081 [main] INFO org.eclipse.jetty.util.log - Logging initialized @2879ms to org.eclipse.jetty.util.log.Slf4jLog
04:18:57.123 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@437ebf59
04:18:57.126 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@347bdeef{/,null,UNAVAILABLE} added {ServletHandler@2aa27288{STOPPED},MANAGED}
04:18:57.128 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@503fbbc6
04:18:57.128 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@55f45b92{/,null,UNAVAILABLE} added {ServletHandler@109f5dd8{STOPPED},MANAGED}
04:18:58.078 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:18:58.079 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:18:58.079 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:18:58.079 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:18:58.080 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:18:58.081 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:18:58.088 [main] DEBUG org.flywaydb.core.internal.command.DbClean - Cleaning schema "public" ...
04:18:58.117 [main] INFO org.flywaydb.core.internal.command.DbClean - Successfully cleaned schema "public" (execution time 00:00.029s)
04:18:58.118 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 193 of 305M
04:18:58.220 [log:pid(14719)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:pg_ctl - waiting for server to shut down.... done
04:18:58.220 [log:pid(14719)] INFO init-721c8089-d117-4cdb-9567-bc441cb5759d:pg_ctl - server stopped
04:18:58.221 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 721c8089-d117-4cdb-9567-bc441cb5759d shut down postmaster in 00:00:00.102
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.837 s - in org.dataone.bookkeeper.jdbi.MembershipStoreTest
[INFO] Running org.dataone.bookkeeper.jdbi.ProductStoreTest
04:18:58.272 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - The files belonging to this database system will be owned by user "jenkins".
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - This user must also own the server process.
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - 
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - The database cluster will be initialized with locale "en_US.UTF-8".
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - The default text search configuration will be set to "english".
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - 
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - Data page checksums are disabled.
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - 
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - fixing permissions on existing directory /tmp/epg4875776669904037500 ... ok
04:18:58.273 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - creating subdirectories ... ok
04:18:58.282 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - selecting default max_connections ... 100
04:18:58.294 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - selecting default shared_buffers ... 128MB
04:18:58.294 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - selecting dynamic shared memory implementation ... posix
04:18:58.364 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - creating configuration files ... ok
04:18:58.456 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - running bootstrap script ... ok
04:18:58.827 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - performing post-bootstrap initialization ... ok
04:18:59.061 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - syncing data to disk ... ok
04:18:59.061 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - 
04:18:59.061 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - Success. You can now start the database server using:
04:18:59.062 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - 
04:18:59.062 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb -     /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca/bin/pg_ctl -D /tmp/epg4875776669904037500 -l logfile start
04:18:59.062 [log:pid(14721)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:initdb - 
04:18:59.062 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 2a70b294-4d21-4612-8655-d0f2a6fa9d23 initdb completed in 00:00:00.797
04:18:59.064 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 2a70b294-4d21-4612-8655-d0f2a6fa9d23 postmaster started as java.lang.UNIXProcess@60a19573 on port 5432.  Waiting up to PT10S for server startup to finish.
04:18:59.075 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - waiting for server to start....2020-09-27 04:18:59.075 UTC [14743] LOG:  listening on IPv6 address "::1", port 5432
04:18:59.075 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - 2020-09-27 04:18:59.075 UTC [14743] LOG:  listening on IPv4 address "127.0.0.1", port 5432
04:18:59.075 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - 2020-09-27 04:18:59.075 UTC [14743] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
04:18:59.121 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - 2020-09-27 04:18:59.120 UTC [14744] LOG:  database system was shut down at 2020-09-27 04:18:58 UTC
04:18:59.123 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - 2020-09-27 04:18:59.123 UTC [14743] LOG:  database system is ready to accept connections
04:18:59.166 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - 2020-09-27 04:18:59.166 UTC [14751] LOG:  incomplete startup packet
04:18:59.169 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 -  done
04:18:59.169 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - server started
04:18:59.174 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 2a70b294-4d21-4612-8655-d0f2a6fa9d23 postmaster startup finished in 00:00:00.111
04:18:59.184 [main] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.6)
04:18:59.184 [main] DEBUG org.flywaydb.core.internal.database.DatabaseFactory - Driver  : PostgreSQL JDBC Driver 42.2.6
04:18:59.185 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:18:59.186 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:18:59.186 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:18:59.186 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:18:59.186 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:18:59.186 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:18:59.187 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:18:59.191 [main] DEBUG org.flywaydb.core.internal.command.DbValidate - Validating migrations ...
04:18:59.191 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.0__Create_Bookkeeper_Database.sql ...
04:18:59.192 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.10__Create_Orders_Table.sql ...
04:18:59.192 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:18:59.193 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:18:59.193 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:18:59.193 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:18:59.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:18:59.195 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.11__Alter_Orders_Add_Customer_FK.sql ...
04:18:59.195 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:18:59.196 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.12__Create_Usages_Table.sql ...
04:18:59.196 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 16: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 19: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:18:59.197 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:18:59.198 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:18:59.198 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.13__Create_Function_Update_Quota_Table_Usage.sql ...
04:18:59.199 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:18:59.199 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 23: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:18:59.199 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:18:59.200 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:18:59.200 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:18:59.201 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:18:59.201 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.14__Alter_Usages_Add_Unique_Constraint.sql ...
04:18:59.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:18:59.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql ...
04:18:59.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:18:59.203 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.1__Create_Quotas_Table.sql ...
04:18:59.203 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:18:59.203 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:18:59.203 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 20: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 22: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:18:59.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:18:59.205 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.2__Insert_Standard_Quotas.sql ...
04:18:59.205 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:18:59.205 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:18:59.205 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 12: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:18:59.206 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.3__Create_Memberships_Table.sql ...
04:18:59.206 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:18:59.207 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:18:59.208 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:18:59.209 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 49: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:18:59.209 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:18:59.209 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 51: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:18:59.209 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 52: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:18:59.209 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 53: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:18:59.209 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.4__Alter_Quotas_Add_Membership_FK.sql ...
04:18:59.210 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:18:59.210 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.5__Create_Customers_Table.sql ...
04:18:59.210 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN customers.description IS 'The customer description'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:18:59.211 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:18:59.212 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:18:59.212 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:18:59.212 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 47: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:18:59.212 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.6__Alter_Memberships_Add_Customer_FK.sql ...
04:18:59.212 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.7__Create_Products_Table.sql ...
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the products table
CREATE SEQUENCE products_id_seq
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX products_active_idx ON products USING btree(active)
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX products_name_idx ON products USING btree(name)
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: CREATE INDEX products_description_idx ON products USING btree(description)
04:18:59.213 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN products.name IS 'The product name.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN products.description IS 'The product general description.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:18:59.214 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.8__Insert_Standard_Products.sql ...
04:18:59.215 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.216 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.218 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.219 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 64: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.220 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 84: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:18:59.221 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 104: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:18:59.222 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.9__Alter_Memberships_Add_Product_FK.sql ...
04:18:59.222 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql (filename: V1.0__Create_Bookkeeper_Database.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.10__Create_Orders_Table.sql (filename: V1.10__Create_Orders_Table.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql (filename: V1.11__Alter_Orders_Add_Customer_FK.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.12__Create_Usages_Table.sql (filename: V1.12__Create_Usages_Table.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql (filename: V1.13__Create_Function_Update_Quota_Table_Usage.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql (filename: V1.14__Alter_Usages_Add_Unique_Constraint.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql (filename: V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.1__Create_Quotas_Table.sql (filename: V1.1__Create_Quotas_Table.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.2__Insert_Standard_Quotas.sql (filename: V1.2__Insert_Standard_Quotas.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.3__Create_Memberships_Table.sql (filename: V1.3__Create_Memberships_Table.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql (filename: V1.4__Alter_Quotas_Add_Membership_FK.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.5__Create_Customers_Table.sql (filename: V1.5__Create_Customers_Table.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql (filename: V1.6__Alter_Memberships_Add_Customer_FK.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.7__Create_Products_Table.sql (filename: V1.7__Create_Products_Table.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.8__Insert_Standard_Products.sql (filename: V1.8__Insert_Standard_Products.sql)
04:18:59.223 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql (filename: V1.9__Alter_Memberships_Add_Product_FK.sql)
04:18:59.224 [main] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 16 migrations (execution time 00:00.032s)
04:18:59.224 [main] DEBUG org.flywaydb.core.internal.command.DbSchemas - Schema "public" already exists. Skipping schema creation.
04:18:59.230 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table: "public"."flyway_schema_history"
04:18:59.230 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing createMetaDataTable.sql ...
04:18:59.232 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 17: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:18:59.232 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:18:59.232 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:18:59.232 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:18:59.235 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.235 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:18:59.236 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.236 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:18:59.236 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.236 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Created Schema History table: "public"."flyway_schema_history"
04:18:59.238 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
04:18:59.239 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.0 - Create Bookkeeper Database
04:18:59.239 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.0 - Create Bookkeeper Database
04:18:59.240 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.242 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.1 - Create Quotas Table
04:18:59.243 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:18:59.243 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.243 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:18:59.245 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.245 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:18:59.245 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.245 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:18:59.245 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.245 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:18:59.246 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.246 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:18:59.246 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.246 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.247 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:18:59.248 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.248 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:18:59.248 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.248 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:18:59.248 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.248 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.1 - Create Quotas Table
04:18:59.249 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.250 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.2 - Insert Standard Quotas
04:18:59.251 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:18:59.251 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.251 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:18:59.252 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.252 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:18:59.252 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.252 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.2 - Insert Standard Quotas
04:18:59.253 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.254 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.3 - Create Memberships Table
04:18:59.255 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:18:59.255 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.255 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:18:59.256 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.256 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:18:59.257 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.257 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:18:59.257 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.257 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:18:59.257 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.257 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.258 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.259 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:18:59.260 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.260 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.3 - Create Memberships Table
04:18:59.260 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.262 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:18:59.262 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:18:59.264 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.264 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:18:59.265 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.266 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.5 - Create Customers Table
04:18:59.266 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:18:59.267 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.267 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:18:59.268 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.268 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:18:59.268 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.268 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.269 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.description IS 'The customer description'
04:18:59.270 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.271 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.5 - Create Customers Table
04:18:59.272 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.275 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:18:59.275 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:18:59.276 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.276 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:18:59.277 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.278 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.7 - Create Products Table
04:18:59.279 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the products table
CREATE SEQUENCE products_id_seq
04:18:59.279 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.279 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:18:59.280 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.280 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:18:59.281 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.281 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_active_idx ON products USING btree(active)
04:18:59.281 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.281 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_name_idx ON products USING btree(name)
04:18:59.281 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.281 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_description_idx ON products USING btree(description)
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:18:59.282 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.name IS 'The product name.'
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.description IS 'The product general description.'
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.283 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.284 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.7 - Create Products Table
04:18:59.285 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.286 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.8 - Insert Standard Products
04:18:59.287 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.288 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.288 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.288 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.288 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.288 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.288 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:18:59.289 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.289 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:18:59.289 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.289 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:18:59.290 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:18:59.290 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.8 - Insert Standard Products
04:18:59.290 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.291 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.9 - Alter Memberships Add Product FK
04:18:59.292 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:18:59.293 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.293 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.9 - Alter Memberships Add Product FK
04:18:59.293 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.294 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.10 - Create Orders Table
04:18:59.295 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:18:59.295 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.295 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:18:59.297 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.297 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:18:59.297 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.297 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:18:59.297 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.297 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.298 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.299 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.10 - Create Orders Table
04:18:59.300 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.301 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.11 - Alter Orders Add Customer FK
04:18:59.302 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:18:59.303 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.303 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.11 - Alter Orders Add Customer FK
04:18:59.303 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.304 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.12 - Create Usages Table
04:18:59.305 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:18:59.305 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.305 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:18:59.306 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.306 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:18:59.307 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.307 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:18:59.307 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.307 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:18:59.307 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.307 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:18:59.308 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.308 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:18:59.308 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.308 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:18:59.308 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.308 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.309 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.12 - Create Usages Table
04:18:59.310 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.311 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:18:59.312 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:18:59.313 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.313 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:18:59.313 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_insert_or_update" for relation "usages" does not exist, skipping
04:18:59.313 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.313 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:18:59.314 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.314 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:18:59.314 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.314 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:18:59.314 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_delete" for relation "usages" does not exist, skipping
04:18:59.314 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.314 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:18:59.314 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.315 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:18:59.315 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.316 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:18:59.317 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:18:59.317 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.317 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:18:59.318 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.319 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:18:59.319 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:18:59.320 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:18:59.320 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:18:59.321 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:18:59.322 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 16 migrations to schema "public" (execution time 00:00.092s)
04:18:59.322 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 216 of 305M
04:18:59.327 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable.
04:18:59.327 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.validation.valuehandling.GuavaOptionalValueExtractor@2ed3b1f5
04:18:59.327 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ConstraintValidatorFactory of type io.dropwizard.jersey.validation.MutableValidatorFactory
04:18:59.327 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ParameterNameProvider of type io.dropwizard.jersey.validation.JerseyParameterNameProvider
04:18:59.328 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.NonEmptyStringParamValueExtractor@4648ce9
04:18:59.328 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.ParamValueExtractor@76ba13c
04:18:59.328 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
04:18:59.328 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL
04:18:59.328 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader
04:18:59.329 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only.
04:18:59.329 [main] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL
04:18:59.333 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider.
04:18:59.334 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator.
04:18:59.334 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver.
04:18:59.334 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider.
04:18:59.334 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider.
04:18:59.334 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory.
04:18:59.335 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@697173d9
04:18:59.335 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@ceddaf8{/,null,UNAVAILABLE} added {ServletHandler@3d90eeb3{STOPPED},MANAGED}
04:18:59.335 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@1db87583
04:18:59.335 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@7fb53256{/,null,UNAVAILABLE} added {ServletHandler@1d6d1d42{STOPPED},MANAGED}
04:18:59.526 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:18:59.526 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:18:59.526 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:18:59.526 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:18:59.527 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:18:59.528 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:18:59.532 [main] DEBUG org.flywaydb.core.internal.command.DbClean - Cleaning schema "public" ...
04:18:59.556 [main] INFO org.flywaydb.core.internal.command.DbClean - Successfully cleaned schema "public" (execution time 00:00.023s)
04:18:59.557 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 90 of 357M
04:18:59.559 [log:pid(14739)] INFO pg-2a70b294-4d21-4612-8655-d0f2a6fa9d23 - 2020-09-27 04:18:59.559 UTC [14743] LOG:  received fast shutdown request
04:18:59.659 [log:pid(14757)] INFO init-2a70b294-4d21-4612-8655-d0f2a6fa9d23:pg_ctl - waiting for server to shut down.... done
04:18:59.660 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 2a70b294-4d21-4612-8655-d0f2a6fa9d23 shut down postmaster in 00:00:00.103
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.435 s - in org.dataone.bookkeeper.jdbi.ProductStoreTest
[INFO] Running org.dataone.bookkeeper.jdbi.QuotaStoreTest
04:18:59.710 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - The files belonging to this database system will be owned by user "jenkins".
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - This user must also own the server process.
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - 
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - The database cluster will be initialized with locale "en_US.UTF-8".
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - The default text search configuration will be set to "english".
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - 
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - Data page checksums are disabled.
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - 
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - fixing permissions on existing directory /tmp/epg2093443910302164168 ... ok
04:18:59.711 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - creating subdirectories ... ok
04:18:59.720 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - selecting default max_connections ... 100
04:18:59.733 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - selecting default shared_buffers ... 128MB
04:18:59.734 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - selecting dynamic shared memory implementation ... posix
04:18:59.804 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - creating configuration files ... ok
04:18:59.897 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - running bootstrap script ... ok
04:19:00.282 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - performing post-bootstrap initialization ... ok
04:19:00.487 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - syncing data to disk ... ok
04:19:00.487 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - 
04:19:00.487 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - Success. You can now start the database server using:
04:19:00.487 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - 
04:19:00.487 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb -     /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca/bin/pg_ctl -D /tmp/epg2093443910302164168 -l logfile start
04:19:00.487 [log:pid(14761)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:initdb - 
04:19:00.489 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - d202960f-77b4-4ed7-99b4-cfed455bb6c6 initdb completed in 00:00:00.787
04:19:00.491 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - d202960f-77b4-4ed7-99b4-cfed455bb6c6 postmaster started as java.lang.UNIXProcess@67d32a54 on port 5432.  Waiting up to PT10S for server startup to finish.
04:19:00.503 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - waiting for server to start....2020-09-27 04:19:00.503 UTC [14779] LOG:  listening on IPv6 address "::1", port 5432
04:19:00.503 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - 2020-09-27 04:19:00.503 UTC [14779] LOG:  listening on IPv4 address "127.0.0.1", port 5432
04:19:00.503 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - 2020-09-27 04:19:00.503 UTC [14779] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
04:19:00.548 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - 2020-09-27 04:19:00.548 UTC [14780] LOG:  database system was shut down at 2020-09-27 04:19:00 UTC
04:19:00.551 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - 2020-09-27 04:19:00.551 UTC [14779] LOG:  database system is ready to accept connections
04:19:00.593 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - 2020-09-27 04:19:00.593 UTC [14789] LOG:  incomplete startup packet
04:19:00.597 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 -  done
04:19:00.597 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - server started
04:19:00.600 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - d202960f-77b4-4ed7-99b4-cfed455bb6c6 postmaster startup finished in 00:00:00.110
04:19:00.608 [main] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.6)
04:19:00.608 [main] DEBUG org.flywaydb.core.internal.database.DatabaseFactory - Driver  : PostgreSQL JDBC Driver 42.2.6
04:19:00.608 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:00.609 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:00.609 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:00.609 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:00.609 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:00.610 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:00.611 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:00.613 [main] DEBUG org.flywaydb.core.internal.command.DbValidate - Validating migrations ...
04:19:00.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.0__Create_Bookkeeper_Database.sql ...
04:19:00.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.10__Create_Orders_Table.sql ...
04:19:00.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.11__Alter_Orders_Add_Customer_FK.sql ...
04:19:00.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.12__Create_Usages_Table.sql ...
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 16: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 19: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:00.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.13__Create_Function_Update_Quota_Table_Usage.sql ...
04:19:00.617 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:00.617 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 23: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:00.617 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:00.617 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:00.617 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:00.617 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:00.617 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.14__Alter_Usages_Add_Unique_Constraint.sql ...
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql ...
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.1__Create_Quotas_Table.sql ...
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 20: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 22: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:00.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.2__Insert_Standard_Quotas.sql ...
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 12: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.3__Create_Memberships_Table.sql ...
04:19:00.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 49: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 51: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 52: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:00.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 53: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.4__Alter_Quotas_Add_Membership_FK.sql ...
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.5__Create_Customers_Table.sql ...
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:00.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 47: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.6__Alter_Memberships_Add_Customer_FK.sql ...
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.7__Create_Products_Table.sql ...
04:19:00.622 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:00.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.8__Insert_Standard_Products.sql ...
04:19:00.624 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.624 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.625 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.625 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 64: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.626 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 84: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:00.626 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 104: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:00.626 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.9__Alter_Memberships_Add_Product_FK.sql ...
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql (filename: V1.0__Create_Bookkeeper_Database.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.10__Create_Orders_Table.sql (filename: V1.10__Create_Orders_Table.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql (filename: V1.11__Alter_Orders_Add_Customer_FK.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.12__Create_Usages_Table.sql (filename: V1.12__Create_Usages_Table.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql (filename: V1.13__Create_Function_Update_Quota_Table_Usage.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql (filename: V1.14__Alter_Usages_Add_Unique_Constraint.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql (filename: V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.1__Create_Quotas_Table.sql (filename: V1.1__Create_Quotas_Table.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.2__Insert_Standard_Quotas.sql (filename: V1.2__Insert_Standard_Quotas.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.3__Create_Memberships_Table.sql (filename: V1.3__Create_Memberships_Table.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql (filename: V1.4__Alter_Quotas_Add_Membership_FK.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.5__Create_Customers_Table.sql (filename: V1.5__Create_Customers_Table.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql (filename: V1.6__Alter_Memberships_Add_Customer_FK.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.7__Create_Products_Table.sql (filename: V1.7__Create_Products_Table.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.8__Insert_Standard_Products.sql (filename: V1.8__Insert_Standard_Products.sql)
04:19:00.627 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql (filename: V1.9__Alter_Memberships_Add_Product_FK.sql)
04:19:00.628 [main] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 16 migrations (execution time 00:00.014s)
04:19:00.628 [main] DEBUG org.flywaydb.core.internal.command.DbSchemas - Schema "public" already exists. Skipping schema creation.
04:19:00.633 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table: "public"."flyway_schema_history"
04:19:00.633 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing createMetaDataTable.sql ...
04:19:00.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 17: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:00.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:00.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:00.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:00.636 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.636 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:00.637 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.637 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:00.637 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.637 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Created Schema History table: "public"."flyway_schema_history"
04:19:00.639 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
04:19:00.639 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.0 - Create Bookkeeper Database
04:19:00.639 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.0 - Create Bookkeeper Database
04:19:00.640 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.641 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.1 - Create Quotas Table
04:19:00.642 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:00.642 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.642 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.646 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.1 - Create Quotas Table
04:19:00.647 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.647 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.2 - Insert Standard Quotas
04:19:00.648 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:00.648 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.648 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:00.649 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.649 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:00.649 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.649 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.2 - Insert Standard Quotas
04:19:00.649 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.650 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.3 - Create Memberships Table
04:19:00.650 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:00.651 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.651 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:00.652 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.652 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:00.652 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.652 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:00.652 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.652 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:00.653 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.654 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.3 - Create Memberships Table
04:19:00.655 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.655 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:00.656 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:00.657 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.657 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:00.657 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.658 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.5 - Create Customers Table
04:19:00.659 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:00.659 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.659 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:00.660 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.660 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:00.660 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.660 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.661 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.662 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:00.663 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.663 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:00.663 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.663 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:00.663 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.663 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.5 - Create Customers Table
04:19:00.663 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.664 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:00.664 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:00.665 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.665 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:00.666 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.667 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.7 - Create Products Table
04:19:00.667 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:00.667 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.667 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:00.669 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.669 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:00.669 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.669 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:00.669 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.669 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.670 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.671 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.7 - Create Products Table
04:19:00.672 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.673 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.8 - Insert Standard Products
04:19:00.673 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.674 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.674 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.674 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.674 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.674 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.674 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:00.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:00.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:00.675 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:00.675 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.8 - Insert Standard Products
04:19:00.676 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.677 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:00.677 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:00.678 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.678 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:00.678 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.679 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.10 - Create Orders Table
04:19:00.679 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:00.680 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.680 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:00.681 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.681 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:00.681 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.682 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:00.682 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.682 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:00.682 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.682 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.683 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:00.684 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.684 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:00.684 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.684 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.10 - Create Orders Table
04:19:00.684 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.685 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:00.685 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:00.686 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.686 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:00.687 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.688 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.12 - Create Usages Table
04:19:00.688 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:00.688 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.688 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:00.689 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.689 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:00.689 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.690 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:00.690 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.690 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:00.690 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.690 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.691 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.12 - Create Usages Table
04:19:00.692 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.693 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:00.693 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:00.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:00.695 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_insert_or_update" for relation "usages" does not exist, skipping
04:19:00.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:00.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.695 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:00.696 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.696 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:00.696 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_delete" for relation "usages" does not exist, skipping
04:19:00.696 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.696 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:00.696 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.696 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:00.697 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.698 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:00.698 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:00.698 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.698 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:00.699 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.700 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:00.700 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:00.701 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:00.701 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:00.701 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:00.702 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 16 migrations to schema "public" (execution time 00:00.069s)
04:19:00.702 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 110 of 357M
04:19:00.706 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable.
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.validation.valuehandling.GuavaOptionalValueExtractor@2ed3b1f5
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ConstraintValidatorFactory of type io.dropwizard.jersey.validation.MutableValidatorFactory
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ParameterNameProvider of type io.dropwizard.jersey.validation.JerseyParameterNameProvider
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.NonEmptyStringParamValueExtractor@4648ce9
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.ParamValueExtractor@76ba13c
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader
04:19:00.707 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only.
04:19:00.708 [main] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL
04:19:00.711 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider.
04:19:00.711 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator.
04:19:00.711 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver.
04:19:00.711 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider.
04:19:00.711 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider.
04:19:00.711 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory.
04:19:00.712 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@4215e133
04:19:00.712 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@5ccb85d6{/,null,UNAVAILABLE} added {ServletHandler@d88f893{STOPPED},MANAGED}
04:19:00.712 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@259b85d6
04:19:00.713 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@48eaf42f{/,null,UNAVAILABLE} added {ServletHandler@488f3dd1{STOPPED},MANAGED}
04:19:00.962 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:00.963 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:00.963 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:00.963 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:00.963 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:00.964 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:00.965 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:00.965 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:00.965 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:00.965 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:00.965 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:00.970 [main] DEBUG org.flywaydb.core.internal.command.DbClean - Cleaning schema "public" ...
04:19:00.995 [main] INFO org.flywaydb.core.internal.command.DbClean - Successfully cleaned schema "public" (execution time 00:00.025s)
04:19:00.996 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 217 of 357M
04:19:00.998 [log:pid(14775)] INFO pg-d202960f-77b4-4ed7-99b4-cfed455bb6c6 - 2020-09-27 04:19:00.998 UTC [14779] LOG:  received fast shutdown request
04:19:01.098 [log:pid(14795)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:pg_ctl - waiting for server to shut down.... done
04:19:01.098 [log:pid(14795)] INFO init-d202960f-77b4-4ed7-99b4-cfed455bb6c6:pg_ctl - server stopped
04:19:01.098 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - d202960f-77b4-4ed7-99b4-cfed455bb6c6 shut down postmaster in 00:00:00.102
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.431 s - in org.dataone.bookkeeper.jdbi.QuotaStoreTest
[INFO] Running org.dataone.bookkeeper.jdbi.OrderStoreTest
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - The files belonging to this database system will be owned by user "jenkins".
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - This user must also own the server process.
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - 
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - The database cluster will be initialized with locale "en_US.UTF-8".
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - The default text search configuration will be set to "english".
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - 
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - Data page checksums are disabled.
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - 
04:19:01.143 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - fixing permissions on existing directory /tmp/epg3949330095798482814 ... ok
04:19:01.144 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - creating subdirectories ... ok
04:19:01.153 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - selecting default max_connections ... 100
04:19:01.169 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - selecting default shared_buffers ... 128MB
04:19:01.170 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - selecting dynamic shared memory implementation ... posix
04:19:01.241 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - creating configuration files ... ok
04:19:01.332 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - running bootstrap script ... ok
04:19:01.705 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - performing post-bootstrap initialization ... ok
04:19:01.911 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - syncing data to disk ... ok
04:19:01.911 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - 
04:19:01.911 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - Success. You can now start the database server using:
04:19:01.911 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - 
04:19:01.911 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb -     /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca/bin/pg_ctl -D /tmp/epg3949330095798482814 -l logfile start
04:19:01.911 [log:pid(14797)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:initdb - 
04:19:01.911 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 62eec67b-14b1-46b6-952f-7e8c957686fa initdb completed in 00:00:00.776
04:19:01.914 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 62eec67b-14b1-46b6-952f-7e8c957686fa postmaster started as java.lang.UNIXProcess@1f129467 on port 5432.  Waiting up to PT10S for server startup to finish.
04:19:01.925 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - waiting for server to start....2020-09-27 04:19:01.925 UTC [14818] LOG:  listening on IPv6 address "::1", port 5432
04:19:01.925 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - 2020-09-27 04:19:01.925 UTC [14818] LOG:  listening on IPv4 address "127.0.0.1", port 5432
04:19:01.925 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - 2020-09-27 04:19:01.925 UTC [14818] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
04:19:01.960 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - 2020-09-27 04:19:01.960 UTC [14819] LOG:  database system was shut down at 2020-09-27 04:19:01 UTC
04:19:01.962 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - 2020-09-27 04:19:01.962 UTC [14818] LOG:  database system is ready to accept connections
04:19:02.017 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - 2020-09-27 04:19:02.017 UTC [14826] LOG:  incomplete startup packet
04:19:02.020 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa -  done
04:19:02.020 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - server started
04:19:02.022 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 62eec67b-14b1-46b6-952f-7e8c957686fa postmaster startup finished in 00:00:00.109
04:19:02.030 [main] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.6)
04:19:02.030 [main] DEBUG org.flywaydb.core.internal.database.DatabaseFactory - Driver  : PostgreSQL JDBC Driver 42.2.6
04:19:02.030 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:02.031 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:02.032 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:02.032 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:02.032 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:02.032 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:02.032 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:02.032 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:02.033 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:02.036 [main] DEBUG org.flywaydb.core.internal.command.DbValidate - Validating migrations ...
04:19:02.036 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.0__Create_Bookkeeper_Database.sql ...
04:19:02.037 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.10__Create_Orders_Table.sql ...
04:19:02.037 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:02.037 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:02.038 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:02.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.11__Alter_Orders_Add_Customer_FK.sql ...
04:19:02.040 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:02.040 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.12__Create_Usages_Table.sql ...
04:19:02.040 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 16: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 19: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:02.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:02.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:02.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:02.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:02.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:02.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.13__Create_Function_Update_Quota_Table_Usage.sql ...
04:19:02.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:02.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 23: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:02.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:02.044 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:02.044 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:02.044 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:02.045 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.14__Alter_Usages_Add_Unique_Constraint.sql ...
04:19:02.045 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:02.045 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql ...
04:19:02.046 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:02.047 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.1__Create_Quotas_Table.sql ...
04:19:02.047 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 20: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 22: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:02.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:02.049 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:02.049 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:02.049 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:02.049 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:02.049 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:02.049 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.2__Insert_Standard_Quotas.sql ...
04:19:02.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:02.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:02.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 12: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:02.051 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.3__Create_Memberships_Table.sql ...
04:19:02.051 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:02.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:02.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:02.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:02.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:02.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:02.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:02.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:02.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:02.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:02.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:02.054 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:02.054 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:02.054 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:02.054 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 49: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:02.055 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:02.055 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 51: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:02.055 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 52: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:02.055 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 53: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:02.056 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.4__Alter_Quotas_Add_Membership_FK.sql ...
04:19:02.056 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:02.057 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.5__Create_Customers_Table.sql ...
04:19:02.057 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:02.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:02.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:02.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:02.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:02.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:02.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:02.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:02.059 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:02.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:02.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:02.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:02.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:02.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 47: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:02.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.6__Alter_Memberships_Add_Customer_FK.sql ...
04:19:02.061 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:02.061 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.7__Create_Products_Table.sql ...
04:19:02.062 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:02.062 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:02.062 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:02.062 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:02.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:02.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:02.067 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.8__Insert_Standard_Products.sql ...
04:19:02.068 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.069 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.070 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.072 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 64: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.073 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 84: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:02.074 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 104: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:02.075 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.9__Alter_Memberships_Add_Product_FK.sql ...
04:19:02.075 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:02.076 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql (filename: V1.0__Create_Bookkeeper_Database.sql)
04:19:02.076 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.10__Create_Orders_Table.sql (filename: V1.10__Create_Orders_Table.sql)
04:19:02.076 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql (filename: V1.11__Alter_Orders_Add_Customer_FK.sql)
04:19:02.076 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.12__Create_Usages_Table.sql (filename: V1.12__Create_Usages_Table.sql)
04:19:02.076 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql (filename: V1.13__Create_Function_Update_Quota_Table_Usage.sql)
04:19:02.076 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql (filename: V1.14__Alter_Usages_Add_Unique_Constraint.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql (filename: V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.1__Create_Quotas_Table.sql (filename: V1.1__Create_Quotas_Table.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.2__Insert_Standard_Quotas.sql (filename: V1.2__Insert_Standard_Quotas.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.3__Create_Memberships_Table.sql (filename: V1.3__Create_Memberships_Table.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql (filename: V1.4__Alter_Quotas_Add_Membership_FK.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.5__Create_Customers_Table.sql (filename: V1.5__Create_Customers_Table.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql (filename: V1.6__Alter_Memberships_Add_Customer_FK.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.7__Create_Products_Table.sql (filename: V1.7__Create_Products_Table.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.8__Insert_Standard_Products.sql (filename: V1.8__Insert_Standard_Products.sql)
04:19:02.077 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql (filename: V1.9__Alter_Memberships_Add_Product_FK.sql)
04:19:02.079 [main] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 16 migrations (execution time 00:00.042s)
04:19:02.079 [main] DEBUG org.flywaydb.core.internal.command.DbSchemas - Schema "public" already exists. Skipping schema creation.
04:19:02.084 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table: "public"."flyway_schema_history"
04:19:02.084 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing createMetaDataTable.sql ...
04:19:02.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 17: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:02.087 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:02.087 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:02.087 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:02.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:02.091 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.091 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:02.092 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.092 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Created Schema History table: "public"."flyway_schema_history"
04:19:02.094 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
04:19:02.094 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.0 - Create Bookkeeper Database
04:19:02.095 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.0 - Create Bookkeeper Database
04:19:02.096 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.097 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.1 - Create Quotas Table
04:19:02.098 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:02.098 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.098 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:02.100 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.100 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:02.100 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.100 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:02.101 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.101 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:02.101 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.101 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:02.102 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.102 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:02.102 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.102 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:02.102 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.102 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:02.102 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.103 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:02.104 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.104 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:02.104 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.104 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:02.104 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.104 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.1 - Create Quotas Table
04:19:02.105 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.107 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.2 - Insert Standard Quotas
04:19:02.108 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:02.108 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.108 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:02.109 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.109 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:02.109 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.109 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.2 - Insert Standard Quotas
04:19:02.110 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.111 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.3 - Create Memberships Table
04:19:02.111 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:02.112 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.112 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:02.113 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.113 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:02.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:02.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:02.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:02.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:02.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.118 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.3 - Create Memberships Table
04:19:02.119 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.120 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:02.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:02.122 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.122 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:02.123 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.124 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.5 - Create Customers Table
04:19:02.124 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:02.125 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.125 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:02.126 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.126 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:02.126 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.126 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:02.127 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.127 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:02.127 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.127 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:02.127 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.128 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:02.129 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.131 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.5 - Create Customers Table
04:19:02.132 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.133 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:02.133 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:02.134 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.135 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:02.135 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.136 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.7 - Create Products Table
04:19:02.137 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:02.137 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.137 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:02.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:02.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:02.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.140 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:02.140 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.140 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:02.140 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.140 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:02.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:02.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:02.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.144 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:02.145 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.145 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.7 - Create Products Table
04:19:02.145 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.146 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.8 - Insert Standard Products
04:19:02.147 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.148 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.148 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.148 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.148 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.149 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.149 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:02.149 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.149 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:02.150 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:02.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:02.151 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.8 - Insert Standard Products
04:19:02.152 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.153 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:02.153 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:02.154 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.154 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:02.155 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.156 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.10 - Create Orders Table
04:19:02.156 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:02.157 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.157 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:02.158 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.158 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:02.159 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.159 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:02.159 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.159 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:02.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:02.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:02.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:02.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:02.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:02.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:02.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.163 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:02.164 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.164 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:02.164 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.164 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.10 - Create Orders Table
04:19:02.165 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.166 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:02.166 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:02.167 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.167 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:02.168 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.169 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.12 - Create Usages Table
04:19:02.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:02.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:02.172 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.172 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:02.172 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.172 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:02.173 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.173 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:02.173 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.173 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:02.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:02.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:02.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:02.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:02.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.176 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.12 - Create Usages Table
04:19:02.177 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.178 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:02.179 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:02.180 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.180 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:02.181 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_insert_or_update" for relation "usages" does not exist, skipping
04:19:02.181 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.181 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:02.181 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.181 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:02.182 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.182 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:02.182 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_delete" for relation "usages" does not exist, skipping
04:19:02.182 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.182 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:02.183 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.183 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:02.184 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.185 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:02.185 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:02.186 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.186 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:02.187 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.188 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:02.188 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:02.189 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:02.189 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:02.190 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:02.191 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 16 migrations to schema "public" (execution time 00:00.107s)
04:19:02.191 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 235 of 357M
04:19:02.196 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable.
04:19:02.196 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.validation.valuehandling.GuavaOptionalValueExtractor@2ed3b1f5
04:19:02.197 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ConstraintValidatorFactory of type io.dropwizard.jersey.validation.MutableValidatorFactory
04:19:02.197 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ParameterNameProvider of type io.dropwizard.jersey.validation.JerseyParameterNameProvider
04:19:02.197 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.NonEmptyStringParamValueExtractor@4648ce9
04:19:02.197 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.ParamValueExtractor@76ba13c
04:19:02.197 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
04:19:02.198 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL
04:19:02.198 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader
04:19:02.198 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only.
04:19:02.199 [main] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL
04:19:02.202 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider.
04:19:02.203 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator.
04:19:02.203 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver.
04:19:02.203 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider.
04:19:02.203 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider.
04:19:02.203 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory.
04:19:02.204 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@31aab981
04:19:02.205 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@26be9a6{/,null,UNAVAILABLE} added {ServletHandler@4d518c66{STOPPED},MANAGED}
04:19:02.205 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@411fa0ce
04:19:02.205 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@251d7fdd{/,null,UNAVAILABLE} added {ServletHandler@78e68401{STOPPED},MANAGED}
04:19:02.465 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:02.466 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:02.466 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:02.467 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:02.472 [main] DEBUG org.flywaydb.core.internal.command.DbClean - Cleaning schema "public" ...
04:19:02.518 [main] INFO org.flywaydb.core.internal.command.DbClean - Successfully cleaned schema "public" (execution time 00:00.046s)
04:19:02.519 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 95 of 416M
04:19:02.521 [log:pid(14814)] INFO pg-62eec67b-14b1-46b6-952f-7e8c957686fa - 2020-09-27 04:19:02.521 UTC [14818] LOG:  received fast shutdown request
04:19:02.621 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 62eec67b-14b1-46b6-952f-7e8c957686fa shut down postmaster in 00:00:00.102
04:19:02.621 [log:pid(14838)] INFO init-62eec67b-14b1-46b6-952f-7e8c957686fa:pg_ctl - waiting for server to shut down.... done
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.522 s - in org.dataone.bookkeeper.jdbi.OrderStoreTest
[INFO] Running org.dataone.bookkeeper.jdbi.UsageStoreTest
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - The files belonging to this database system will be owned by user "jenkins".
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - This user must also own the server process.
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - 
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - The database cluster will be initialized with locale "en_US.UTF-8".
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - The default text search configuration will be set to "english".
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - 
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - Data page checksums are disabled.
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - 
04:19:02.670 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - fixing permissions on existing directory /tmp/epg8475748329771218472 ... ok
04:19:02.714 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - creating subdirectories ... ok
04:19:02.727 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - selecting default max_connections ... 100
04:19:02.761 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - selecting default shared_buffers ... 128MB
04:19:02.761 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - selecting dynamic shared memory implementation ... posix
04:19:02.835 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - creating configuration files ... ok
04:19:02.999 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - running bootstrap script ... ok
04:19:03.513 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - performing post-bootstrap initialization ... ok
04:19:03.851 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - syncing data to disk ... ok
04:19:03.851 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - 
04:19:03.851 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - Success. You can now start the database server using:
04:19:03.851 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - 
04:19:03.852 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb -     /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca/bin/pg_ctl -D /tmp/epg8475748329771218472 -l logfile start
04:19:03.852 [log:pid(14845)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:initdb - 
04:19:03.853 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - f06de493-dc25-46bb-beab-24c57f59cce6 initdb completed in 00:00:01.190
04:19:03.855 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - f06de493-dc25-46bb-beab-24c57f59cce6 postmaster started as java.lang.UNIXProcess@e01a26b on port 5432.  Waiting up to PT10S for server startup to finish.
04:19:03.869 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - waiting for server to start....2020-09-27 04:19:03.869 UTC [14865] LOG:  listening on IPv6 address "::1", port 5432
04:19:03.869 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - 2020-09-27 04:19:03.869 UTC [14865] LOG:  listening on IPv4 address "127.0.0.1", port 5432
04:19:03.869 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - 2020-09-27 04:19:03.869 UTC [14865] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
04:19:03.927 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - 2020-09-27 04:19:03.927 UTC [14866] LOG:  database system was shut down at 2020-09-27 04:19:03 UTC
04:19:03.930 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - 2020-09-27 04:19:03.930 UTC [14865] LOG:  database system is ready to accept connections
04:19:03.957 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - 2020-09-27 04:19:03.957 UTC [14873] LOG:  incomplete startup packet
04:19:03.962 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 -  done
04:19:03.962 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - server started
04:19:03.967 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - f06de493-dc25-46bb-beab-24c57f59cce6 postmaster startup finished in 00:00:00.113
04:19:03.979 [main] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.6)
04:19:03.979 [main] DEBUG org.flywaydb.core.internal.database.DatabaseFactory - Driver  : PostgreSQL JDBC Driver 42.2.6
04:19:03.980 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:03.980 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:03.980 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:03.980 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:03.981 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:03.982 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:03.982 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.command.DbValidate - Validating migrations ...
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.0__Create_Bookkeeper_Database.sql ...
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.10__Create_Orders_Table.sql ...
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:03.988 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.11__Alter_Orders_Add_Customer_FK.sql ...
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.12__Create_Usages_Table.sql ...
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 16: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 19: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:03.989 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.13__Create_Function_Update_Quota_Table_Usage.sql ...
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 23: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:03.990 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.14__Alter_Usages_Add_Unique_Constraint.sql ...
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql ...
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.1__Create_Quotas_Table.sql ...
04:19:03.991 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 20: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 22: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.2__Insert_Standard_Quotas.sql ...
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 12: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:03.992 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.3__Create_Memberships_Table.sql ...
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 49: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 51: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 52: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:03.993 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 53: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.4__Alter_Quotas_Add_Membership_FK.sql ...
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.5__Create_Customers_Table.sql ...
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:03.994 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 47: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.6__Alter_Memberships_Add_Customer_FK.sql ...
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.7__Create_Products_Table.sql ...
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:03.995 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.8__Insert_Standard_Products.sql ...
04:19:03.996 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:03.997 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:03.997 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:03.998 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 64: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:03.998 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 84: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 104: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.9__Alter_Memberships_Add_Product_FK.sql ...
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql (filename: V1.0__Create_Bookkeeper_Database.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.10__Create_Orders_Table.sql (filename: V1.10__Create_Orders_Table.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql (filename: V1.11__Alter_Orders_Add_Customer_FK.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.12__Create_Usages_Table.sql (filename: V1.12__Create_Usages_Table.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql (filename: V1.13__Create_Function_Update_Quota_Table_Usage.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql (filename: V1.14__Alter_Usages_Add_Unique_Constraint.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql (filename: V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.1__Create_Quotas_Table.sql (filename: V1.1__Create_Quotas_Table.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.2__Insert_Standard_Quotas.sql (filename: V1.2__Insert_Standard_Quotas.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.3__Create_Memberships_Table.sql (filename: V1.3__Create_Memberships_Table.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql (filename: V1.4__Alter_Quotas_Add_Membership_FK.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.5__Create_Customers_Table.sql (filename: V1.5__Create_Customers_Table.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql (filename: V1.6__Alter_Memberships_Add_Customer_FK.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.7__Create_Products_Table.sql (filename: V1.7__Create_Products_Table.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.8__Insert_Standard_Products.sql (filename: V1.8__Insert_Standard_Products.sql)
04:19:03.999 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql (filename: V1.9__Alter_Memberships_Add_Product_FK.sql)
04:19:04.000 [main] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 16 migrations (execution time 00:00.012s)
04:19:04.000 [main] DEBUG org.flywaydb.core.internal.command.DbSchemas - Schema "public" already exists. Skipping schema creation.
04:19:04.007 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table: "public"."flyway_schema_history"
04:19:04.007 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing createMetaDataTable.sql ...
04:19:04.007 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 17: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:04.007 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:04.008 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:04.008 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:04.011 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.011 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:04.012 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.012 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:04.012 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.012 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Created Schema History table: "public"."flyway_schema_history"
04:19:04.014 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
04:19:04.015 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.0 - Create Bookkeeper Database
04:19:04.015 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.0 - Create Bookkeeper Database
04:19:04.016 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.017 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.1 - Create Quotas Table
04:19:04.018 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:04.019 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.019 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:04.020 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.020 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:04.021 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.021 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:04.021 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.021 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:04.021 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.021 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:04.022 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.022 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:04.022 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.022 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:04.022 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.022 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.023 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.1 - Create Quotas Table
04:19:04.024 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.025 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.2 - Insert Standard Quotas
04:19:04.025 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:04.026 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.027 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:04.027 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.027 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:04.027 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.027 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.2 - Insert Standard Quotas
04:19:04.028 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.028 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.3 - Create Memberships Table
04:19:04.029 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:04.029 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.029 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:04.031 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.031 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:04.031 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.031 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:04.031 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.031 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.032 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.3 - Create Memberships Table
04:19:04.033 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.035 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:04.035 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:04.037 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.037 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:04.037 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.038 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.5 - Create Customers Table
04:19:04.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:04.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.039 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:04.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:04.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:04.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.041 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:04.042 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.043 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.5 - Create Customers Table
04:19:04.044 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.045 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:04.045 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:04.046 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.046 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:04.047 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.048 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.7 - Create Products Table
04:19:04.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:04.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.048 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:04.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:04.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:04.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.050 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:04.051 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.051 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:04.051 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.051 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.052 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.053 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.7 - Create Products Table
04:19:04.054 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.055 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.8 - Insert Standard Products
04:19:04.055 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:04.056 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.056 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:04.056 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.056 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:04.057 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.057 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:04.057 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.057 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:04.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:04.058 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:04.058 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.8 - Insert Standard Products
04:19:04.058 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.059 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:04.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:04.060 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.060 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:04.061 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.062 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.10 - Create Orders Table
04:19:04.062 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:04.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.063 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:04.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:04.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.064 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:04.065 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.066 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.10 - Create Orders Table
04:19:04.067 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.068 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:04.068 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:04.069 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.069 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:04.070 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.071 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.12 - Create Usages Table
04:19:04.071 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:04.071 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.071 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:04.084 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.084 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:04.084 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.084 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:04.085 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.085 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:04.085 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.085 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.086 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.12 - Create Usages Table
04:19:04.087 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.088 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:04.088 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:04.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:04.090 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_insert_or_update" for relation "usages" does not exist, skipping
04:19:04.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:04.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.090 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:04.091 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.091 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:04.091 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_delete" for relation "usages" does not exist, skipping
04:19:04.091 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.091 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:04.091 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.091 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:04.092 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.092 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:04.093 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:04.093 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.093 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:04.094 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.095 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:04.095 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:04.096 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:04.096 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:04.096 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:04.097 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 16 migrations to schema "public" (execution time 00:00.090s)
04:19:04.097 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 118 of 416M
04:19:04.100 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable.
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.validation.valuehandling.GuavaOptionalValueExtractor@2ed3b1f5
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ConstraintValidatorFactory of type io.dropwizard.jersey.validation.MutableValidatorFactory
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ParameterNameProvider of type io.dropwizard.jersey.validation.JerseyParameterNameProvider
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.NonEmptyStringParamValueExtractor@4648ce9
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.ParamValueExtractor@76ba13c
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader
04:19:04.101 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only.
04:19:04.102 [main] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL
04:19:04.104 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider.
04:19:04.104 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator.
04:19:04.104 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver.
04:19:04.104 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider.
04:19:04.104 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider.
04:19:04.104 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory.
04:19:04.105 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@62735b13
04:19:04.105 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@7aae1170{/,null,UNAVAILABLE} added {ServletHandler@4ef5dd23{STOPPED},MANAGED}
04:19:04.105 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@163e8949
04:19:04.105 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@6eede35e{/,null,UNAVAILABLE} added {ServletHandler@64c25a62{STOPPED},MANAGED}
04:19:04.183 [log:pid(14861)] INFO pg-f06de493-dc25-46bb-beab-24c57f59cce6 - 2020-09-27 04:19:04.183 UTC [14877] ERROR:  duplicate key value violates unique constraint "usages_quotaid_instanceid_idx"
04:19:04.366 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:04.367 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:04.367 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:04.367 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:04.367 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:04.367 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:04.367 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:04.367 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:04.368 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:04.372 [main] DEBUG org.flywaydb.core.internal.command.DbClean - Cleaning schema "public" ...
04:19:04.394 [main] INFO org.flywaydb.core.internal.command.DbClean - Successfully cleaned schema "public" (execution time 00:00.022s)
04:19:04.394 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 234 of 416M
04:19:04.496 [log:pid(14879)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:pg_ctl - waiting for server to shut down.... done
04:19:04.496 [log:pid(14879)] INFO init-f06de493-dc25-46bb-beab-24c57f59cce6:pg_ctl - server stopped
04:19:04.497 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - f06de493-dc25-46bb-beab-24c57f59cce6 shut down postmaster in 00:00:00.103
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.876 s - in org.dataone.bookkeeper.jdbi.UsageStoreTest
[INFO] Running org.dataone.bookkeeper.jdbi.CustomerStoreTest
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - The files belonging to this database system will be owned by user "jenkins".
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - This user must also own the server process.
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - 
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - The database cluster will be initialized with locale "en_US.UTF-8".
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - The default text search configuration will be set to "english".
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - 
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - Data page checksums are disabled.
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - 
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - fixing permissions on existing directory /tmp/epg8637556306240596091 ... ok
04:19:04.547 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - creating subdirectories ... ok
04:19:04.559 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - selecting default max_connections ... 100
04:19:04.576 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - selecting default shared_buffers ... 128MB
04:19:04.576 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - selecting dynamic shared memory implementation ... posix
04:19:04.644 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - creating configuration files ... ok
04:19:04.742 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - running bootstrap script ... ok
04:19:05.163 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - performing post-bootstrap initialization ... ok
04:19:05.405 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - syncing data to disk ... ok
04:19:05.405 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - 
04:19:05.405 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - Success. You can now start the database server using:
04:19:05.405 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - 
04:19:05.405 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb -     /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca/bin/pg_ctl -D /tmp/epg8637556306240596091 -l logfile start
04:19:05.405 [log:pid(14881)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:initdb - 
04:19:05.407 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - b16519c8-e661-44f0-9416-e935e0e1a79b initdb completed in 00:00:00.868
04:19:05.409 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - b16519c8-e661-44f0-9416-e935e0e1a79b postmaster started as java.lang.UNIXProcess@59127611 on port 5432.  Waiting up to PT10S for server startup to finish.
04:19:05.422 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - waiting for server to start....2020-09-27 04:19:05.422 UTC [14903] LOG:  listening on IPv6 address "::1", port 5432
04:19:05.422 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - 2020-09-27 04:19:05.422 UTC [14903] LOG:  listening on IPv4 address "127.0.0.1", port 5432
04:19:05.422 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - 2020-09-27 04:19:05.422 UTC [14903] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
04:19:05.459 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - 2020-09-27 04:19:05.458 UTC [14904] LOG:  database system was shut down at 2020-09-27 04:19:05 UTC
04:19:05.461 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - 2020-09-27 04:19:05.461 UTC [14903] LOG:  database system is ready to accept connections
04:19:05.512 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - 2020-09-27 04:19:05.512 UTC [14912] LOG:  incomplete startup packet
04:19:05.516 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b -  done
04:19:05.516 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - server started
04:19:05.518 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - b16519c8-e661-44f0-9416-e935e0e1a79b postmaster startup finished in 00:00:00.109
04:19:05.530 [main] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.6)
04:19:05.530 [main] DEBUG org.flywaydb.core.internal.database.DatabaseFactory - Driver  : PostgreSQL JDBC Driver 42.2.6
04:19:05.530 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:05.531 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:05.531 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:05.531 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:05.531 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:05.531 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:05.531 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:05.531 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:05.532 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.command.DbValidate - Validating migrations ...
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.0__Create_Bookkeeper_Database.sql ...
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.10__Create_Orders_Table.sql ...
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:05.536 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.11__Alter_Orders_Add_Customer_FK.sql ...
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.12__Create_Usages_Table.sql ...
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 16: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 19: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:05.537 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:05.538 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.13__Create_Function_Update_Quota_Table_Usage.sql ...
04:19:05.538 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:05.538 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 23: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:05.538 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:05.538 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:05.538 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:05.539 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:05.539 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.14__Alter_Usages_Add_Unique_Constraint.sql ...
04:19:05.539 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:05.539 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql ...
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.1__Create_Quotas_Table.sql ...
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 20: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 22: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:05.540 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.2__Insert_Standard_Quotas.sql ...
04:19:05.541 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:05.542 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:05.542 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 12: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:05.542 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.3__Create_Memberships_Table.sql ...
04:19:05.542 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:05.542 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:05.542 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 49: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 51: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 52: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:05.543 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 53: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:05.544 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.4__Alter_Quotas_Add_Membership_FK.sql ...
04:19:05.544 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:05.544 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.5__Create_Customers_Table.sql ...
04:19:05.544 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:05.545 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 47: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.6__Alter_Memberships_Add_Customer_FK.sql ...
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:05.546 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.7__Create_Products_Table.sql ...
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:05.547 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:05.548 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:05.548 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:05.548 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:05.548 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:05.548 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:05.548 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:05.548 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.8__Insert_Standard_Products.sql ...
04:19:05.549 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.549 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.549 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.550 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 64: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.551 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 84: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:05.551 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 104: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:05.551 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.9__Alter_Memberships_Add_Product_FK.sql ...
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql (filename: V1.0__Create_Bookkeeper_Database.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.10__Create_Orders_Table.sql (filename: V1.10__Create_Orders_Table.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql (filename: V1.11__Alter_Orders_Add_Customer_FK.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.12__Create_Usages_Table.sql (filename: V1.12__Create_Usages_Table.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql (filename: V1.13__Create_Function_Update_Quota_Table_Usage.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql (filename: V1.14__Alter_Usages_Add_Unique_Constraint.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql (filename: V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.1__Create_Quotas_Table.sql (filename: V1.1__Create_Quotas_Table.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.2__Insert_Standard_Quotas.sql (filename: V1.2__Insert_Standard_Quotas.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.3__Create_Memberships_Table.sql (filename: V1.3__Create_Memberships_Table.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql (filename: V1.4__Alter_Quotas_Add_Membership_FK.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.5__Create_Customers_Table.sql (filename: V1.5__Create_Customers_Table.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql (filename: V1.6__Alter_Memberships_Add_Customer_FK.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.7__Create_Products_Table.sql (filename: V1.7__Create_Products_Table.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.8__Insert_Standard_Products.sql (filename: V1.8__Insert_Standard_Products.sql)
04:19:05.552 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql (filename: V1.9__Alter_Memberships_Add_Product_FK.sql)
04:19:05.553 [main] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 16 migrations (execution time 00:00.017s)
04:19:05.554 [main] DEBUG org.flywaydb.core.internal.command.DbSchemas - Schema "public" already exists. Skipping schema creation.
04:19:05.559 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table: "public"."flyway_schema_history"
04:19:05.559 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing createMetaDataTable.sql ...
04:19:05.560 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 17: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:05.560 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:05.560 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:05.560 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:05.563 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.563 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:05.564 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.564 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:05.564 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.564 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Created Schema History table: "public"."flyway_schema_history"
04:19:05.566 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
04:19:05.566 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.0 - Create Bookkeeper Database
04:19:05.567 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.0 - Create Bookkeeper Database
04:19:05.568 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.569 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.1 - Create Quotas Table
04:19:05.570 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:05.571 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.571 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:05.572 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.572 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:05.573 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.573 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:05.573 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.573 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:05.574 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.574 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:05.574 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.574 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:05.574 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.574 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:05.575 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.576 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:05.576 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.576 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:05.576 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.576 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:05.576 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.576 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.1 - Create Quotas Table
04:19:05.577 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.578 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.2 - Insert Standard Quotas
04:19:05.579 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:05.579 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.580 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:05.580 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.580 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:05.580 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.580 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.2 - Insert Standard Quotas
04:19:05.581 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.582 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.3 - Create Memberships Table
04:19:05.583 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:05.583 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.583 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:05.585 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.585 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:05.585 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.585 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:05.586 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.586 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:05.586 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.586 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:05.586 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.586 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.587 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.588 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:05.589 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.589 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:05.589 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.589 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:05.589 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.589 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.3 - Create Memberships Table
04:19:05.590 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.591 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:05.591 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:05.593 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.593 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:05.594 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.595 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.5 - Create Customers Table
04:19:05.595 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:05.596 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.596 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:05.597 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.597 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:05.597 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.597 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.598 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.599 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.600 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.601 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.5 - Create Customers Table
04:19:05.602 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.605 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:05.605 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:05.606 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.606 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:05.607 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.608 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.7 - Create Products Table
04:19:05.609 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:05.609 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.609 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:05.610 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.611 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:05.611 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.611 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:05.611 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.611 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:05.612 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.612 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:05.612 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.612 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:05.612 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.612 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.613 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:05.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:05.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:05.614 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.615 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:05.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:05.616 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.616 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.7 - Create Products Table
04:19:05.616 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.617 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.8 - Insert Standard Products
04:19:05.618 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.619 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:05.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.620 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:05.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:05.621 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:05.621 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.8 - Insert Standard Products
04:19:05.622 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.623 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:05.623 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:05.624 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.624 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:05.625 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.626 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.10 - Create Orders Table
04:19:05.627 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:05.628 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.628 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:05.629 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.629 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:05.630 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.630 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:05.630 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.630 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.631 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.632 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:05.633 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.633 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.634 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.10 - Create Orders Table
04:19:05.635 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.636 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:05.636 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:05.637 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.638 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:05.638 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.639 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.12 - Create Usages Table
04:19:05.640 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:05.640 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.640 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:05.642 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.642 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:05.642 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.642 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:05.643 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.643 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:05.643 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.643 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:05.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:05.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:05.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.644 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:05.645 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.646 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.12 - Create Usages Table
04:19:05.646 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.647 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:05.648 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:05.650 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.650 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:05.650 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_insert_or_update" for relation "usages" does not exist, skipping
04:19:05.650 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.650 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:05.650 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.651 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:05.651 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.651 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:05.651 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_delete" for relation "usages" does not exist, skipping
04:19:05.651 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.651 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:05.652 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.652 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:05.652 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.653 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:05.654 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:05.655 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.655 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:05.655 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.656 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:05.657 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:05.657 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:05.657 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:05.658 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:05.659 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 16 migrations to schema "public" (execution time 00:00.100s)
04:19:05.659 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 256 of 416M
04:19:05.662 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable.
04:19:05.663 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.validation.valuehandling.GuavaOptionalValueExtractor@2ed3b1f5
04:19:05.663 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ConstraintValidatorFactory of type io.dropwizard.jersey.validation.MutableValidatorFactory
04:19:05.663 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ParameterNameProvider of type io.dropwizard.jersey.validation.JerseyParameterNameProvider
04:19:05.663 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.NonEmptyStringParamValueExtractor@4648ce9
04:19:05.663 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.ParamValueExtractor@76ba13c
04:19:05.663 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
04:19:05.663 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL
04:19:05.664 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader
04:19:05.664 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only.
04:19:05.664 [main] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL
04:19:05.667 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider.
04:19:05.667 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator.
04:19:05.667 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver.
04:19:05.667 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider.
04:19:05.667 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider.
04:19:05.667 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory.
04:19:05.668 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@6210666c
04:19:05.668 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@1dca62c2{/,null,UNAVAILABLE} added {ServletHandler@52657d5f{STOPPED},MANAGED}
04:19:05.668 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@43d3995f
04:19:05.668 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@2211b44f{/,null,UNAVAILABLE} added {ServletHandler@6c830ebd{STOPPED},MANAGED}
04:19:05.929 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:05.929 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:05.929 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:05.929 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:05.930 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:05.934 [main] DEBUG org.flywaydb.core.internal.command.DbClean - Cleaning schema "public" ...
04:19:05.958 [main] INFO org.flywaydb.core.internal.command.DbClean - Successfully cleaned schema "public" (execution time 00:00.023s)
04:19:05.959 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 27 of 415M
04:19:05.961 [log:pid(14898)] INFO pg-b16519c8-e661-44f0-9416-e935e0e1a79b - 2020-09-27 04:19:05.961 UTC [14903] LOG:  received fast shutdown request
04:19:06.061 [log:pid(14920)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:pg_ctl - waiting for server to shut down.... done
04:19:06.061 [log:pid(14920)] INFO init-b16519c8-e661-44f0-9416-e935e0e1a79b:pg_ctl - server stopped
04:19:06.062 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - b16519c8-e661-44f0-9416-e935e0e1a79b shut down postmaster in 00:00:00.103
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.564 s - in org.dataone.bookkeeper.jdbi.CustomerStoreTest
[INFO] Running org.dataone.bookkeeper.EmbeddedPostgresqlTest
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - The files belonging to this database system will be owned by user "jenkins".
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - This user must also own the server process.
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - 
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - The database cluster will be initialized with locale "en_US.UTF-8".
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - The default text search configuration will be set to "english".
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - 
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - Data page checksums are disabled.
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - 
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - fixing permissions on existing directory /tmp/epg3016663435392475259 ... ok
04:19:06.116 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - creating subdirectories ... ok
04:19:06.127 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - selecting default max_connections ... 100
04:19:06.142 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - selecting default shared_buffers ... 128MB
04:19:06.142 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - selecting dynamic shared memory implementation ... posix
04:19:06.212 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - creating configuration files ... ok
04:19:06.305 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - running bootstrap script ... ok
04:19:06.664 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - performing post-bootstrap initialization ... ok
04:19:06.992 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - syncing data to disk ... ok
04:19:06.992 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - 
04:19:06.992 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - Success. You can now start the database server using:
04:19:06.992 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - 
04:19:06.992 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb -     /tmp/embedded-pg/PG-06e3a92a2edb6ddd6dbdf5602d0252ca/bin/pg_ctl -D /tmp/epg3016663435392475259 -l logfile start
04:19:06.992 [log:pid(14922)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:initdb - 
04:19:06.993 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 50af2027-5de1-4691-a1f7-018cd41c5239 initdb completed in 00:00:00.886
04:19:06.995 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 50af2027-5de1-4691-a1f7-018cd41c5239 postmaster started as java.lang.UNIXProcess@eb91027 on port 5432.  Waiting up to PT10S for server startup to finish.
04:19:07.005 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - waiting for server to start....2020-09-27 04:19:07.005 UTC [14942] LOG:  listening on IPv6 address "::1", port 5432
04:19:07.005 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - 2020-09-27 04:19:07.005 UTC [14942] LOG:  listening on IPv4 address "127.0.0.1", port 5432
04:19:07.005 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - 2020-09-27 04:19:07.005 UTC [14942] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
04:19:07.042 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - 2020-09-27 04:19:07.041 UTC [14943] LOG:  database system was shut down at 2020-09-27 04:19:06 UTC
04:19:07.044 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - 2020-09-27 04:19:07.044 UTC [14942] LOG:  database system is ready to accept connections
04:19:07.096 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - 2020-09-27 04:19:07.096 UTC [14950] LOG:  incomplete startup packet
04:19:07.100 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 -  done
04:19:07.101 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - server started
04:19:07.102 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 50af2027-5de1-4691-a1f7-018cd41c5239 postmaster startup finished in 00:00:00.108
04:19:07.109 [main] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.6)
04:19:07.109 [main] DEBUG org.flywaydb.core.internal.database.DatabaseFactory - Driver  : PostgreSQL JDBC Driver 42.2.6
04:19:07.109 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:07.109 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:07.109 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:07.109 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:07.110 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:07.111 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:07.111 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:07.113 [main] DEBUG org.flywaydb.core.internal.command.DbValidate - Validating migrations ...
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.0__Create_Bookkeeper_Database.sql ...
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.10__Create_Orders_Table.sql ...
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:07.114 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.11__Alter_Orders_Add_Customer_FK.sql ...
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.12__Create_Usages_Table.sql ...
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 16: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 19: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:07.115 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.13__Create_Function_Update_Quota_Table_Usage.sql ...
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 23: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:07.116 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.14__Alter_Usages_Add_Unique_Constraint.sql ...
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql ...
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.1__Create_Quotas_Table.sql ...
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 18: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 20: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 21: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 22: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 25: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:07.117 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.2__Insert_Standard_Quotas.sql ...
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 12: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.3__Create_Memberships_Table.sql ...
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:07.118 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 48: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 49: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 50: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 51: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 52: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 53: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.4__Alter_Quotas_Add_Membership_FK.sql ...
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.5__Create_Customers_Table.sql ...
04:19:07.119 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 30: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 47: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.6__Alter_Memberships_Add_Customer_FK.sql ...
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:07.120 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.7__Create_Products_Table.sql ...
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 7: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 26: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 27: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 28: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 32: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 33: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 34: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 35: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 36: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 37: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 38: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 39: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 40: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 41: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 42: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 43: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 45: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 46: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:07.121 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.8__Insert_Standard_Products.sql ...
04:19:07.122 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 3: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.122 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 24: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.123 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 44: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.123 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 64: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 84: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 104: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing V1.9__Alter_Memberships_Add_Product_FK.sql ...
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 4: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql (filename: V1.0__Create_Bookkeeper_Database.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.10__Create_Orders_Table.sql (filename: V1.10__Create_Orders_Table.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql (filename: V1.11__Alter_Orders_Add_Customer_FK.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.12__Create_Usages_Table.sql (filename: V1.12__Create_Usages_Table.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql (filename: V1.13__Create_Function_Update_Quota_Table_Usage.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql (filename: V1.14__Alter_Usages_Add_Unique_Constraint.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql (filename: V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.1__Create_Quotas_Table.sql (filename: V1.1__Create_Quotas_Table.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.2__Insert_Standard_Quotas.sql (filename: V1.2__Insert_Standard_Quotas.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.3__Create_Memberships_Table.sql (filename: V1.3__Create_Memberships_Table.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql (filename: V1.4__Alter_Quotas_Add_Membership_FK.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.5__Create_Customers_Table.sql (filename: V1.5__Create_Customers_Table.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql (filename: V1.6__Alter_Memberships_Add_Customer_FK.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.7__Create_Products_Table.sql (filename: V1.7__Create_Products_Table.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.8__Insert_Standard_Products.sql (filename: V1.8__Insert_Standard_Products.sql)
04:19:07.124 [main] DEBUG org.flywaydb.core.internal.scanner.Scanner - Filtering out resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql (filename: V1.9__Alter_Memberships_Add_Product_FK.sql)
04:19:07.125 [main] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 16 migrations (execution time 00:00.011s)
04:19:07.126 [main] DEBUG org.flywaydb.core.internal.command.DbSchemas - Schema "public" already exists. Skipping schema creation.
04:19:07.130 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table: "public"."flyway_schema_history"
04:19:07.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Parsing createMetaDataTable.sql ...
04:19:07.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 17: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:07.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 29: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:07.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.SqlScript - Found statement at line 31: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:07.130 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE "public"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INTEGER,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP NOT NULL DEFAULT now(),
    "execution_time" INTEGER NOT NULL,
    "success" BOOLEAN NOT NULL
)
04:19:07.133 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.133 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE "public"."flyway_schema_history" ADD CONSTRAINT "flyway_schema_history_pk" PRIMARY KEY ("installed_rank")
04:19:07.133 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.133 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX "flyway_schema_history_s_idx" ON "public"."flyway_schema_history" ("success")
04:19:07.134 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.134 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Created Schema History table: "public"."flyway_schema_history"
04:19:07.136 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
04:19:07.136 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.0 - Create Bookkeeper Database
04:19:07.136 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.0 - Create Bookkeeper Database
04:19:07.137 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.138 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.1 - Create Quotas Table
04:19:07.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the quotas table
CREATE SEQUENCE IF NOT EXISTS quotas_id_seq
04:19:07.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.139 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS quotas (
    id integer DEFAULT nextval('quotas_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaType text NOT NULL,
    softLimit double precision NOT NULL,
    hardLimit double precision NOT NULL,
    totalUsage double precision,
    unit text NOT NULL,
    membershipId integer,
    owner text
)
04:19:07.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE quotas_id_seq OWNED BY quotas.id
04:19:07.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_quotaType_idx ON quotas USING btree(quotaType)
04:19:07.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.141 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_membershipId_idx ON quotas USING btree(membershipId)
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX quotas_owner_idx ON quotas USING btree(owner)
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE quotas IS 'Quotas limiting resources for products per customer. Quotas may be associated with products or customers by their ids.'
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.id IS 'The unique quota identifier'
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.142 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.object IS 'The serialized object type, set to "quota"'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.quotaType IS 'The quota type'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.softLimit IS 'The soft limit of the resource.'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.hardLimit IS 'The hard limit of the resource.'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.totalUsage IS 'The current observed total usage of the quota.'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.unit IS 'The named unit of the quota.'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.membershipId IS 'The membership id to which the quota is applied.'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN quotas.owner IS 'The owner identifier to which the quota is applied.'
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.143 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.1 - Create Quotas Table
04:19:07.144 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.145 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.2 - Insert Standard Quotas
04:19:07.145 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1GB base storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'storage', 1073741824.0, 1181116006.4, NULL, 'byte', NULL, NULL)
04:19:07.146 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.146 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- 1TB base hosted repository storage limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'repository_storage', 1099511627776.0, 1209462790553.6, NULL, 'byte', NULL,
    NULL)
04:19:07.146 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.146 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Single base branded portal limit
INSERT INTO quotas (object, quotaType, softLimit, hardLimit, totalUsage, unit, membershipId, owner)
    VALUES ('quota', 'portal', 1.0, 1.0, NULL, 'portal', NULL, NULL)
04:19:07.146 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.147 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.2 - Insert Standard Quotas
04:19:07.147 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.148 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.3 - Create Memberships Table
04:19:07.148 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the memberships table
CREATE SEQUENCE memberships_id_seq
04:19:07.149 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.149 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS memberships (
    id integer DEFAULT nextval('memberships_id_seq') PRIMARY KEY,
    object text NOT NULL,
    --- billingCycleAnchor timestamp with time zone,
    canceledAt timestamp with time zone,
    collectionMethod text NOT NULL,
    created timestamp with time zone,
    --- currentPeriodEnd timestamp with time zone,
    --- currentPeriodStart timestamp with time zone,
    customerId integer NOT NULL,
    --- daysUntilDue integer,
    discount json,
    --- endedAt timestamp with time zone,
    --- latestInvoice json,
    metadata json,
    productId integer NOT NULL,
    quantity integer,
    startDate timestamp with time zone,
    status text NOT NULL,
    trialEnd timestamp with time zone,
    trialStart timestamp with time zone
)
04:19:07.150 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.150 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE memberships_id_seq OWNED BY memberships.id
04:19:07.150 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.150 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_customer_id_idx ON memberships USING btree(customerId)
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX memberships_status_idx ON memberships USING btree(status)
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  memberships IS 'Memberships with products and their quotas by customers.'
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.id IS 'The unique membership identifier.'
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.object IS 'The serialized object type, set to "membership".'
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.151 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.billingCycleAnchor IS 'The timestamp used to calculate membership billing cycles.';
COMMENT ON COLUMN memberships.canceledAt IS 'The timestamp when the membership was canceled.'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.collectionMethod IS 'The payment collection (charge_automatically, or send_invoice).'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.created IS 'The timestamp when the membership was created.'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.currentPeriodEnd IS 'The timestamp when the current membership period ends.';
--- COMMENT ON COLUMN memberships.currentPeriodStart IS 'The timestamp when the current membership period ends.';
COMMENT ON COLUMN memberships.customerId IS 'The customer identifier.'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- COMMENT ON COLUMN memberships.daysUntilDue IS 'The number of days until the membership payment is due.';
--- COMMENT ON COLUMN memberships.discount IS 'The discount JSON object applied to the membership.';
--- COMMENT ON COLUMN memberships.endedAt IS 'The timestamp when the membership ended.';
--- COMMENT ON COLUMN memberships.latestInvoice IS 'The latest invoice JSON object for the membership.';
COMMENT ON COLUMN memberships.metadata IS 'The membership metadata, stored as a JSON object (undefined as of yet)'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.productId IS 'The purchased product identifier.'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.quantity IS 'The quantity of the purchased product.'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.startDate IS 'The timestamp when the membership starts.'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.status  IS 'The membership status'
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.152 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialEnd  IS 'The timestamp when the membership trial starts.'
04:19:07.153 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.153 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN memberships.trialStart  IS 'The timestamp when the membership trial ends.'
04:19:07.153 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.153 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.3 - Create Memberships Table
04:19:07.153 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.154 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:07.155 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the membership id foreign key constraint
ALTER TABLE quotas
    ADD CONSTRAINT quotas_membership_id_fk
    FOREIGN KEY (membershipId) REFERENCES memberships (id) ON DELETE CASCADE
04:19:07.156 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.156 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.4 - Alter Quotas Add Membership FK
04:19:07.156 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.157 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.5 - Create Customers Table
04:19:07.158 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the customers table
CREATE SEQUENCE customers_id_seq
04:19:07.158 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.158 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS customers (
    id integer DEFAULT nextval('customers_id_seq') PRIMARY KEY,
    object text NOT NULL,
    subject text NOT NULL,
    balance integer,
    address json,
    created timestamp with time zone,
    currency text,
    delinquent boolean,
    description text,
    discount json,
    email text,
    invoicePrefix text,
    invoiceSettings json,
    metadata json,
    givenName text,
    surName text,
    phone text
)
04:19:07.159 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.159 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE customers_id_seq OWNED BY customers.id
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_subject_idx ON customers USING btree(subject)
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX customers_email_idx ON customers USING btree(email)
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE customers IS 'Customers that have ordered products and have quotas.'
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.id IS 'The unique customer identifier.'
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.160 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.object IS 'The serialized object type, set to "customer".'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.subject IS 'The unique customer Subject identifier.'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.balance IS 'The customer balance, in the smallest unit of the currency (i.e. USD cents).'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.address IS 'The customer address, stored as a JSON address object.'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.created IS 'The customer creation date.'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.currency IS 'The customer currency, defaults to "USD".'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.delinquent IS 'The customer delinquency status, true or false'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.description IS 'The customer description'
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.161 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.discount IS 'The customer discount, stored as a JSON Discount object.'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.email IS 'The customer email address.'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoicePrefix IS 'The customer invoice prefix'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.invoiceSettings IS 'The customer settings, stored as a JSON InvoiceSettings object'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.metadata IS 'The customer metadata, stored as a JSON object (undefined as of yet)'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.givenName IS 'The customer given name'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.surName IS 'The customer surname'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN customers.phone IS 'The customer phone'
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.162 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.5 - Create Customers Table
04:19:07.163 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.164 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:07.164 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_customers_id_fk
    FOREIGN KEY (customerId) REFERENCES customers (id) ON DELETE CASCADE
04:19:07.165 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.165 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.6 - Alter Memberships Add Customer FK
04:19:07.166 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.166 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.7 - Create Products Table
04:19:07.167 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the products table
CREATE SEQUENCE products_id_seq
04:19:07.167 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.167 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS products (
    id integer DEFAULT nextval('products_id_seq') PRIMARY KEY,
    object text NOT NULL,
    active boolean,
    amount integer NOT NULL,
    name text,
    caption text,
    currency text NOT NULL,
    description text,
    interval text NOT NULL,
    created timestamp with time zone,
    statementDescriptor text,
    type text,
    unitLabel text,
    url text,
    metadata json
)
04:19:07.168 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.168 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE products_id_seq OWNED BY products.id
04:19:07.169 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.169 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_active_idx ON products USING btree(active)
04:19:07.169 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.169 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_name_idx ON products USING btree(name)
04:19:07.169 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.169 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_caption_idx ON products USING btree(caption)
04:19:07.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX products_description_idx ON products USING btree(description)
04:19:07.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  products IS 'Products that are offered as services.'
04:19:07.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.id IS 'The unique product identifier'
04:19:07.170 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.object IS 'The serialized object type, set to "product"'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.active IS 'The active status for the product, true or false.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.amount IS 'The cost amount for the product, in pence of the currency'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.name IS 'The product name.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.caption IS 'The product caption, used for display.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.currency IS 'The product currency as a 3-letter ISO currency code.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.description IS 'The product general description.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.interval IS 'The product payment interval (day, week, month, year).'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.created IS 'The product creation date.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.statementDescriptor IS 'The product statement descriptor used on charge statements.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.type IS 'The product type, either service or good.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.unitLabel IS 'The product unit label.'
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.171 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.url IS 'The product URL used for more information.'
04:19:07.172 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.172 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN products.metadata IS 'The product metadata JSON object, currently a feature list.'
04:19:07.172 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.172 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.7 - Create Products Table
04:19:07.172 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.173 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.8 - Insert Standard Products
04:19:07.173 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Individual Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    32000,
    'Faculty or research lab',
    now(),
    'USD',
    'Create a customized portal for your work and projects. Help others understand and access your data.',
    'year',
    'Individual',
    'DataONE Membership Plan - Individual',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "1","hardLimit": "1","totalUsage": "0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Small Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    200000,
    'Small institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Small Organization',
    'DataONE Membership Plan - Small Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "5","hardLimit": "5","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.174 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Medium Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    600000,
    'Medium institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Medium Organization',
    'DataONE Membership Plan - Medium Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "portal","softLimit": "15","hardLimit": "15","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Large Organization Membership
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    true,
    2800000,
    'Large institutions or groups',
    now(),
    'USD',
    'Create multiple portals for your work and projects. Help others understand and access your data.',
    'year',
    'Large Organization',
    'DataONE Membership Plan - Large Organization',
    'service',
    'membership',
    'https://products.dataone.org/plus',
    '{"features": [{"name": "branded_portal","label": "Branded Portals","description": "Showcase your research, data, results, and usage metrics by building a custom web portal.","quota": {"object": "quota","quotaType": "branded_portal","softLimit": "50","hardLimit": "50","totalUsage":"0","unit": "portal"}},{"name": "custom_search_filters","label": "Custom Search Filters","description": "Create custom search filters in your portal to allow scientists to search your holdings using filters appropriate to your field of science."},{"name": "fair_data_assessment","label": "FAIR Data Assessments","description": "Access quality metric reports using the FAIR data suite of checks."},{"name": "custom_quality_service","label": "Custom Quality Metrics","description": "Create a suite of custom quality metadata checks specific to your datasets."},{"name": "aggregated_metrics","label": "Aggregated Metrics","description": "Access and share reports on aggregated usage metrics such as dataset views, data downloads, and dataset citations."},{"name": "dataone_voting_member","label": "DataONE Voting Member","description": "Vote on the direction and priorities at DataONE Community meetings."}]}'
)
04:19:07.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.175 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Hosted Repository
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    1200000,
    'A dedicated repository solution for your group or institution’s data, managed by DataONE',
    now(),
    'USD',
    'Bring the products of your research lab, field station, or library together in a centralized location for efficient sharing, access, and reuse. Accelerate research activity, foster new collaborations, and build community with a repository that meets your needs and reflects your brand.',
    'year',
    'DataONE Hosted Repository',
    'DataONE Hosted Repository',
    'service',
    'repository',
    'https://products.dataone.org/hostedrepo',
    '{"features": [{"name": "trusted_data_repository","label": "A Trusted Data Repository","description": "Preserve and share your data, software, and derived products in a dedicated repository system. Built on our robust and expertly managed repository software and hardware, your research products are safely inactive and easily accessible."},{"name": "individual_fair_Assessments","label": "Individual FAIR Assessments","description": "Evaluate your metadata with community established FAIR principles. Scores are refreshed with updates to your metadata, helping make your data even more Findable, Accessible, Interoperable, and Reusable."},{"name": "powerful_online_submission","label": "Powerful Online Submission","description": "The user friendly data submission tool helps your researchers efficiently upload and describe their data. Users can easily create detailed metadata to enhance interoperability, reusability, and value of data."},{"name": "comprehensive_search","label": "Comprehensive Search","description": "Quickly find data with detailed search filters, or by navigating the interactive map."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "usage_metrics","label": "Usage Metrics","description": "Understand how your data are being used over time with view, download, and citation metrics."},{"name": "expandable_storage","label": "Expandable Storage","description": "Grow your repository capacity based on your storage needs in 1 TB increments.","quota": {"object": "quota","quotaType": "repository_storage","softLimit": 1048576,"hardLimit": 1153434,"totalUsage": 0,"unit": "portal"}},{"name": "geographic_replicas","label": "Geographic Replicas","description": "Your data are replicated to distinct geographic regions for high availability and preservation."},{"name": "api_access","label": "API Access","description": "Programmatically work with your repository through the DataONE tools in R, Python, Matlab, and Java."},{"name": "link_data_and_software","label": "Link data and Software","description": "Easily show how your files relate to each other by providing well-described provenance workflows."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "private_and_public_access","label": "Private and Public Access","description": "Control access to your datasets\nprior to publication with private groups or just yourself."},{"name": "any_file_format","label": "Any File Format","description": "Use the scientific file formats for your community: image, tabular, text, audio, video, and others."},{"name": "share_when_ready","label": "Share When Ready","description": "Keep your dataset private while you document it thoroughly, and then make it public when you are ready."}]}'
)
04:19:07.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: -- Archival Storage
INSERT INTO products (object, active, amount, caption, created, currency, description,
    interval, name, statementDescriptor, type, unitLabel, url, metadata)
VALUES (
    'product',
    'true',
    126000,
    'Additional High Availability Data Storage',
    now(),
    'USD',
    'Increase the available storage in your dedicated hosted repository in 1 TB increments.',
    'year',
    'Additional Data Storage',
    'Additional Data Storage',
    'service',
    'storage',
    'https://products.dataone.org/hostedrepo',
    '{}'
)
04:19:07.176 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 1
04:19:07.176 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.8 - Insert Standard Products
04:19:07.177 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.178 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:07.178 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the product id foreign key constraint
ALTER TABLE memberships
    ADD CONSTRAINT memberships_products_id_fk
    FOREIGN KEY (productId) REFERENCES products (id) ON DELETE CASCADE
04:19:07.179 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.179 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.9 - Alter Memberships Add Product FK
04:19:07.180 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.180 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.10 - Create Orders Table
04:19:07.181 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the orders table
CREATE SEQUENCE orders_id_seq
04:19:07.181 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.181 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS orders (
    id integer DEFAULT nextval('orders_id_seq') PRIMARY KEY,
    object text NOT NULL,
    amount integer,
    amountReturned integer,
    charge json,
    created timestamp with time zone,
    currency text,
    customer integer,
    email text,
    items json,
    metadata json,
    status text,
    statusTransitions json,
    updated timestamp with time zone
)
04:19:07.182 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.182 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_customer_idx ON orders USING btree(customer)
04:19:07.183 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.183 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_email_idx ON orders USING btree(email)
04:19:07.183 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.183 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX orders_status_idx ON orders USING btree(status)
04:19:07.183 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.183 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  orders IS 'Orders of products by customers.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.id IS 'The unique order identifier.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.object IS 'The serialized object type, set to "order".'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amount IS 'The order amount in the smallest unit of the currency.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.amountReturned IS 'The order amount returned in the smallest unit of the currency.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.charge IS 'The order transaction charge JSON object.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.created IS 'The order creation date.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.currency IS 'The order currency code.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.customer IS 'The order customer identifier.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.email IS 'The order customer email.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.items IS 'The order items list JSON object.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.metadata IS 'The order metadata JSON object.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.status IS 'The order status (created, paid, canceled, fulfilled, returned.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.statusTransitions IS 'The order status/date transitions JSON object'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN orders.updated IS 'The order update date.'
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.184 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.10 - Create Orders Table
04:19:07.187 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.188 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:07.188 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add the customer id foreign key constraint
ALTER TABLE orders
    ADD CONSTRAINT orders_customer_id_fk
    FOREIGN KEY (customer) REFERENCES customers (id) ON DELETE CASCADE
04:19:07.189 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.189 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.11 - Alter Orders Add Customer FK
04:19:07.190 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.190 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.12 - Create Usages Table
04:19:07.191 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the usages table
CREATE SEQUENCE IF NOT EXISTS usages_id_seq
04:19:07.191 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.191 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TABLE IF NOT EXISTS usages (
    id integer DEFAULT nextval('usages_id_seq') PRIMARY KEY,
    object text NOT NULL,
    quotaId integer NOT NULL,
    instanceId text NOT NULL,
    quantity double precision NOT NULL,
    status text,
    nodeId text NOT NULL
)
04:19:07.192 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.192 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER SEQUENCE usages_id_seq OWNED BY usages.id
04:19:07.192 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.192 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_quotaId_idx ON usages USING btree(quotaId)
04:19:07.193 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.193 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE INDEX usages_instanceId_idx ON usages USING btree(instanceId)
04:19:07.193 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.193 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: ALTER TABLE usages
    ADD CONSTRAINT usages_quotas_id_fk
    FOREIGN KEY (quotaId) REFERENCES quotas (id) ON DELETE CASCADE
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON TABLE  usages IS 'Usages records each instance a portion of a quota is used.'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.id IS 'The unique usage identifier.'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.object IS 'The serialized object type, set to "usage".'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quotaId IS 'The quota identifier.'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.instanceId IS 'The instance identifier using a portion of the quota.'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.quantity IS 'The quantity used by the instance, in the quota units.'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.status IS 'The status of the usage, active or inactive.'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: COMMENT ON COLUMN usages.nodeId IS 'The quota node identifier".'
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.194 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.12 - Create Usages Table
04:19:07.197 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.198 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:07.200 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota usage function for inserts and updates
CREATE OR REPLACE FUNCTION update_quota_usage_on_insert_or_update()
    RETURNS trigger
    AS $update_quota_usage_on_insert_or_update$
    BEGIN
        -- Check that quotaId is given
        IF NEW.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.totalUsage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = NEW.quotaId)
                WHERE q.id = NEW.quotaId;
        RETURN NEW;
    END;
    $update_quota_usage_on_insert_or_update$
    LANGUAGE plpgsql
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_insert_or_update ON usages
04:19:07.202 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_insert_or_update" for relation "usages" does not exist, skipping
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_insert_or_update AFTER INSERT OR UPDATE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_insert_or_update()
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage function for deletes
CREATE OR REPLACE FUNCTION update_quota_usage_on_delete()
    RETURNS trigger
    AS $update_quota_usage_on_delete$
    BEGIN
        -- Check that quotaId is given
        IF OLD.quotaId IS NULL THEN
            RAISE EXCEPTION 'quotaId cannot be null';
        END IF;

        -- Update the quotas.usage column
        UPDATE quotas q
            SET totalUsage = (SELECT SUM(u.quantity) FROM usages u WHERE u.status != 'inactive' AND u.quotaId = OLD.quotaId)
                WHERE q.id = OLD.quotaId;
        RETURN OLD;
    END;
    $update_quota_usage_on_delete$
    LANGUAGE plpgsql
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.202 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Create the update quota totalUsage trigger
DROP TRIGGER IF EXISTS update_quotas_usage_on_delete ON usages
04:19:07.202 [main] INFO org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - DB: trigger "update_quotas_usage_on_delete" for relation "usages" does not exist, skipping
04:19:07.203 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.203 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: CREATE TRIGGER update_quotas_usage_on_delete AFTER DELETE ON usages
    FOR EACH ROW
        EXECUTE PROCEDURE update_quota_usage_on_delete()
04:19:07.203 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.203 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.13 - Create Function Update Quota Table Usage
04:19:07.203 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.204 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:07.204 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the usage table for the 'quotaid' + 'instanceid' columns
CREATE UNIQUE INDEX usages_quotaid_instanceid_idx
    ON usages USING btree(quotaid,instanceid)
04:19:07.205 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.205 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.14 - Alter Usages Add Unique Constraint
04:19:07.205 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.206 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:07.206 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Executing SQL: --- Add a unique constraint to the quotas table for the 'membershipId' + 'quotaType' columns
CREATE UNIQUE INDEX quotas_membership_id_quota_type_idx
    ON quotas USING btree(membershipId, quotaType)
04:19:07.207 [main] DEBUG org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor - Update Count: 0
04:19:07.207 [main] DEBUG org.flywaydb.core.internal.command.DbMigrate - Successfully completed migration of schema "public" to version 1.15 - Alter Quotas Add Unique Constraint MembershipId QuotaType
04:19:07.207 [main] DEBUG org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Schema History table "public"."flyway_schema_history" successfully updated to reflect changes
04:19:07.208 [main] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 16 migrations to schema "public" (execution time 00:00.078s)
04:19:07.208 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 54 of 415M
04:19:07.211 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable.
04:19:07.211 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.validation.valuehandling.GuavaOptionalValueExtractor@2ed3b1f5
04:19:07.211 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ConstraintValidatorFactory of type io.dropwizard.jersey.validation.MutableValidatorFactory
04:19:07.211 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom ParameterNameProvider of type io.dropwizard.jersey.validation.JerseyParameterNameProvider
04:19:07.211 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.NonEmptyStringParamValueExtractor@4648ce9
04:19:07.212 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Adding value extractor io.dropwizard.jersey.validation.ParamValueExtractor@76ba13c
04:19:07.212 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
04:19:07.212 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL
04:19:07.212 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader
04:19:07.212 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only.
04:19:07.212 [main] DEBUG org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator - Loaded expression factory via original TCCL
04:19:07.214 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider.
04:19:07.215 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator as ValidatorFactory-scoped message interpolator.
04:19:07.215 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver.
04:19:07.215 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider.
04:19:07.215 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider.
04:19:07.215 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory.
04:19:07.215 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@578b2dec
04:19:07.215 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@66863941{/,null,UNAVAILABLE} added {ServletHandler@39f4a7c4{STOPPED},MANAGED}
04:19:07.215 [main] DEBUG org.eclipse.jetty.util.DecoratedObjectFactory - Adding Decorator: org.eclipse.jetty.util.DeprecationWarning@111fe921
04:19:07.215 [main] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - i.d.j.MutableServletContextHandler@1ff542a3{/,null,UNAVAILABLE} added {ServletHandler@48ee3c2d{STOPPED},MANAGED}
04:19:07.229 [main] DEBUG org.flywaydb.core.Flyway - DDL Transactions Supported: true
04:19:07.229 [main] DEBUG org.flywaydb.core.Flyway - Schema: public
04:19:07.229 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classpath resources at 'classpath:db/migrations' ...
04:19:07.229 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Determining location urls for classpath:db/migrations using ClassLoader sun.misc.Launcher$AppClassLoader@7f31245a ...
04:19:07.229 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning URL: file:/var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - JBoss VFS v2 available: false
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning starting at classpath root in filesystem: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.FileSystemClassPathLocationScanner - Scanning for resources in path: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/classes/db/migrations (db/migrations)
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.0__Create_Bookkeeper_Database.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.10__Create_Orders_Table.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.11__Alter_Orders_Add_Customer_FK.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.12__Create_Usages_Table.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.13__Create_Function_Update_Quota_Table_Usage.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.14__Alter_Usages_Add_Unique_Constraint.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.15__Alter_Quotas_Add_Unique_Constraint_MembershipId_QuotaType.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.1__Create_Quotas_Table.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.2__Insert_Standard_Quotas.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.3__Create_Memberships_Table.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.4__Alter_Quotas_Add_Membership_FK.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.5__Create_Customers_Table.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.6__Alter_Memberships_Add_Customer_FK.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.7__Create_Products_Table.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.8__Insert_Standard_Products.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Found resource: db/migrations/V1.9__Alter_Memberships_Add_Product_FK.sql
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.scanner.classpath.ClassPathScanner - Scanning for classes at classpath:db/migrations
04:19:07.230 [main] DEBUG org.flywaydb.core.internal.callback.SqlScriptCallbackFactory - Scanning for SQL callbacks ...
04:19:07.231 [main] DEBUG org.flywaydb.core.internal.util.FeatureDetector - Spring Jdbc available: false
04:19:07.235 [main] DEBUG org.flywaydb.core.internal.command.DbClean - Cleaning schema "public" ...
04:19:07.256 [main] INFO org.flywaydb.core.internal.command.DbClean - Successfully cleaned schema "public" (execution time 00:00.020s)
04:19:07.256 [main] DEBUG org.flywaydb.core.Flyway - Memory usage: 60 of 415M
04:19:07.259 [log:pid(14938)] INFO pg-50af2027-5de1-4691-a1f7-018cd41c5239 - 2020-09-27 04:19:07.258 UTC [14942] LOG:  received fast shutdown request
04:19:07.358 [log:pid(14955)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:pg_ctl - waiting for server to shut down.... done
04:19:07.358 [log:pid(14955)] INFO init-50af2027-5de1-4691-a1f7-018cd41c5239:pg_ctl - server stopped
04:19:07.358 [main] INFO com.opentable.db.postgres.embedded.EmbeddedPostgres - 50af2027-5de1-4691-a1f7-018cd41c5239 shut down postmaster in 00:00:00.102
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.319 s - in org.dataone.bookkeeper.EmbeddedPostgresqlTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 71, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[JENKINS] Recording test results
[INFO] 
[INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ bookkeeper ---
[INFO] Building jar: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/bookkeeper-0.1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-shade-plugin:3.2.1:shade (default) @ bookkeeper ---
[INFO] Including io.dropwizard:dropwizard-core:jar:2.0.0 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-util:jar:2.0.0 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-annotations:jar:2.10.1 in the shaded jar.
[INFO] Including com.google.guava:guava:jar:28.1-jre in the shaded jar.
[INFO] Including com.google.guava:failureaccess:jar:1.0.1 in the shaded jar.
[INFO] Including com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava in the shaded jar.
[INFO] Including com.google.j2objc:j2objc-annotations:jar:1.3 in the shaded jar.
[INFO] Including org.codehaus.mojo:animal-sniffer-annotations:jar:1.18 in the shaded jar.
[INFO] Including com.google.code.findbugs:jsr305:jar:3.0.2 in the shaded jar.
[INFO] Including joda-time:joda-time:jar:2.10.5 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-jackson:jar:2.0.0 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-core:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.core:jackson-databind:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.datatype:jackson-datatype-guava:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.module:jackson-module-afterburner:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.10.1 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-validation:jar:2.0.0 in the shaded jar.
[INFO] Including org.hibernate.validator:hibernate-validator:jar:6.1.0.Final in the shaded jar.
[INFO] Including jakarta.validation:jakarta.validation-api:jar:2.0.2 in the shaded jar.
[INFO] Including org.jboss.logging:jboss-logging:jar:3.3.2.Final in the shaded jar.
[INFO] Including com.fasterxml:classmate:jar:1.3.4 in the shaded jar.
[INFO] Including org.glassfish:jakarta.el:jar:3.0.3 in the shaded jar.
[INFO] Including org.javassist:javassist:jar:3.26.0-GA in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-configuration:jar:2.0.0 in the shaded jar.
[INFO] Including com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.10.1 in the shaded jar.
[INFO] Including org.yaml:snakeyaml:jar:1.24 in the shaded jar.
[INFO] Including org.apache.commons:commons-text:jar:1.8 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-logging:jar:2.0.0 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-logback:jar:4.1.2 in the shaded jar.
[INFO] Including org.slf4j:jul-to-slf4j:jar:1.7.29 in the shaded jar.
[INFO] Including ch.qos.logback:logback-core:jar:1.2.3 in the shaded jar.
[INFO] Including ch.qos.logback:logback-classic:jar:1.2.3 in the shaded jar.
[INFO] Including io.dropwizard.logback:logback-throttling-appender:jar:1.1.0 in the shaded jar.
[INFO] Including org.slf4j:log4j-over-slf4j:jar:1.7.29 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-util:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-metrics:jar:2.0.0 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-jersey:jar:2.0.0 in the shaded jar.
[INFO] Including org.glassfish.jersey.core:jersey-server:jar:2.29.1 in the shaded jar.
[INFO] Including org.glassfish.jersey.core:jersey-common:jar:2.29.1 in the shaded jar.
[INFO] Including org.glassfish.hk2:osgi-resource-locator:jar:1.0.3 in the shaded jar.
[INFO] Including jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6 in the shaded jar.
[INFO] Including org.glassfish.jersey.media:jersey-media-jaxb:jar:2.29.1 in the shaded jar.
[INFO] Including jakarta.annotation:jakarta.annotation-api:jar:1.3.5 in the shaded jar.
[INFO] Including org.glassfish.hk2.external:jakarta.inject:jar:2.6.1 in the shaded jar.
[INFO] Including org.glassfish.jersey.ext:jersey-metainf-services:jar:2.29.1 in the shaded jar.
[INFO] Including org.glassfish.jersey.ext:jersey-bean-validation:jar:2.29.1 in the shaded jar.
[INFO] Including org.glassfish.jersey.inject:jersey-hk2:jar:2.29.1 in the shaded jar.
[INFO] Including org.glassfish.hk2:hk2-locator:jar:2.6.1 in the shaded jar.
[INFO] Including org.glassfish.hk2.external:aopalliance-repackaged:jar:2.6.1 in the shaded jar.
[INFO] Including org.glassfish.hk2:hk2-api:jar:2.6.1 in the shaded jar.
[INFO] Including org.glassfish.hk2:hk2-utils:jar:2.6.1 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-jersey2:jar:4.1.2 in the shaded jar.
[INFO] Including com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.10.1 in the shaded jar.
[INFO] Including com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.10.1 in the shaded jar.
[INFO] Including jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2 in the shaded jar.
[INFO] Including jakarta.activation:jakarta.activation-api:jar:1.2.1 in the shaded jar.
[INFO] Including org.glassfish.jersey.containers:jersey-container-servlet:jar:2.29.1 in the shaded jar.
[INFO] Including org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.29.1 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-server:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including javax.servlet:javax.servlet-api:jar:3.1.0 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-io:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-webapp:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-xml:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-continuation:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including javax.xml.bind:jaxb-api:jar:2.3.1 in the shaded jar.
[INFO] Including javax.activation:javax.activation-api:jar:1.2.0 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-servlets:jar:2.0.0 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-annotation:jar:4.1.2 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-jetty:jar:2.0.0 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-jetty9:jar:4.1.2 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-servlet:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-security:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-servlets:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including org.eclipse.jetty:jetty-http:jar:9.4.24.v20191120 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-lifecycle:jar:2.0.0 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-core:jar:4.1.2 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-jvm:jar:4.1.2 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-jmx:jar:4.1.2 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-servlets:jar:4.1.2 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-json:jar:4.1.2 in the shaded jar.
[INFO] Including com.helger:profiler:jar:1.1.1 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-healthchecks:jar:4.1.2 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-request-logging:jar:2.0.0 in the shaded jar.
[INFO] Including ch.qos.logback:logback-access:jar:1.2.3 in the shaded jar.
[INFO] Including net.sourceforge.argparse4j:argparse4j:jar:0.8.1 in the shaded jar.
[INFO] Including org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:jar:1.0.3 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-json-logging:jar:2.0.0 in the shaded jar.
[INFO] Including org.glassfish.jersey.core:jersey-client:jar:2.29.1 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-jdbi3:jar:2.0.0 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-db:jar:2.0.0 in the shaded jar.
[INFO] Including org.apache.tomcat:tomcat-jdbc:jar:9.0.29 in the shaded jar.
[INFO] Including org.apache.tomcat:tomcat-juli:jar:9.0.29 in the shaded jar.
[INFO] Including org.jdbi:jdbi3-core:jar:3.11.1 in the shaded jar.
[INFO] Including org.antlr:antlr4-runtime:jar:4.7.2 in the shaded jar.
[INFO] Including io.leangen.geantyref:geantyref:jar:1.3.7 in the shaded jar.
[INFO] Including org.jdbi:jdbi3-sqlobject:jar:3.11.1 in the shaded jar.
[INFO] Including org.jdbi:jdbi3-jodatime2:jar:3.11.1 in the shaded jar.
[INFO] Including org.jdbi:jdbi3-guava:jar:3.11.1 in the shaded jar.
[INFO] Including io.dropwizard.metrics:metrics-jdbi3:jar:4.1.2 in the shaded jar.
[INFO] Including io.dropwizard:dropwizard-auth:jar:2.0.0 in the shaded jar.
[INFO] Including com.github.ben-manes.caffeine:caffeine:jar:2.8.0 in the shaded jar.
[INFO] Including org.checkerframework:checker-qual:jar:2.10.0 in the shaded jar.
[INFO] Including com.google.errorprone:error_prone_annotations:jar:2.3.3 in the shaded jar.
[INFO] Including org.postgresql:postgresql:jar:42.2.6 in the shaded jar.
[INFO] Including org.slf4j:slf4j-api:jar:1.7.25 in the shaded jar.
[INFO] Including org.apache.commons:commons-lang3:jar:3.7 in the shaded jar.
[INFO] Including commons-io:commons-io:jar:2.6 in the shaded jar.
[INFO] Including commons-codec:commons-codec:jar:1.11 in the shaded jar.
[INFO] Including org.slf4j:jcl-over-slf4j:jar:1.7.25 in the shaded jar.
[INFO] Including org.flywaydb:flyway-maven-plugin:jar:5.2.4 in the shaded jar.
[INFO] Including org.apache.maven:maven-plugin-api:jar:3.0 in the shaded jar.
[INFO] Including org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2 in the shaded jar.
[INFO] Including org.sonatype.sisu:sisu-inject-bean:jar:1.4.2 in the shaded jar.
[INFO] Including org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7 in the shaded jar.
[INFO] Including org.apache.maven:maven-artifact:jar:3.0 in the shaded jar.
[INFO] Including org.apache.maven:maven-model:jar:3.0 in the shaded jar.
[INFO] Including org.apache.maven:maven-core:jar:3.0 in the shaded jar.
[INFO] Including org.apache.maven:maven-settings:jar:3.0 in the shaded jar.
[INFO] Including org.apache.maven:maven-settings-builder:jar:3.0 in the shaded jar.
[INFO] Including org.apache.maven:maven-repository-metadata:jar:3.0 in the shaded jar.
[INFO] Including org.apache.maven:maven-model-builder:jar:3.0 in the shaded jar.
[INFO] Including org.apache.maven:maven-aether-provider:jar:3.0 in the shaded jar.
[INFO] Including org.sonatype.aether:aether-impl:jar:1.7 in the shaded jar.
[INFO] Including org.sonatype.aether:aether-spi:jar:1.7 in the shaded jar.
[INFO] Including org.sonatype.aether:aether-api:jar:1.7 in the shaded jar.
[INFO] Including org.sonatype.aether:aether-util:jar:1.7 in the shaded jar.
[INFO] Including org.codehaus.plexus:plexus-interpolation:jar:1.14 in the shaded jar.
[INFO] Including org.codehaus.plexus:plexus-classworlds:jar:2.2.3 in the shaded jar.
[INFO] Including org.codehaus.plexus:plexus-component-annotations:jar:1.5.5 in the shaded jar.
[INFO] Including org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4 in the shaded jar.
[INFO] Including org.sonatype.plexus:plexus-cipher:jar:1.4 in the shaded jar.
[INFO] Including org.codehaus.plexus:plexus-utils:jar:1.5.15 in the shaded jar.
[INFO] Including org.flywaydb:flyway-core:jar:5.2.4 in the shaded jar.
[INFO] Including org.dataone:d1_libclient_java:jar:2.3.1 in the shaded jar.
[INFO] Including net.sf.jsignature.io-tools:easystream:jar:1.2.12 in the shaded jar.
[INFO] Including commons-collections:commons-collections:jar:3.2.1 in the shaded jar.
[INFO] Including javax.mail:mail:jar:1.4.1 in the shaded jar.
[INFO] Including javax.activation:activation:jar:1.1 in the shaded jar.
[INFO] Including org.jibx:jibx-run:jar:1.2.4.5 in the shaded jar.
[INFO] Including xpp3:xpp3:jar:1.1.3.4.O in the shaded jar.
[INFO] Including org.bouncycastle:bcpkix-jdk15on:jar:1.52 in the shaded jar.
[INFO] Including org.bouncycastle:bcprov-jdk15on:jar:1.52 in the shaded jar.
[INFO] Including commons-lang:commons-lang:jar:2.6 in the shaded jar.
[INFO] Including org.dataone:d1_common_java:jar:2.3.0 in the shaded jar.
[INFO] Including log4j:log4j:jar:1.2.17 in the shaded jar.
[INFO] Including org.apache.maven.plugins:maven-jar-plugin:maven-plugin:2.3.1 in the shaded jar.
[INFO] Including org.apache.maven:maven-project:jar:2.0.6 in the shaded jar.
[INFO] Including org.apache.maven:maven-profile:jar:2.0.6 in the shaded jar.
[INFO] Including org.apache.maven:maven-artifact-manager:jar:2.0.6 in the shaded jar.
[INFO] Including org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2 in the shaded jar.
[INFO] Including org.apache.maven:maven-plugin-registry:jar:2.0.6 in the shaded jar.
[INFO] Including org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 in the shaded jar.
[INFO] Including classworlds:classworlds:jar:1.1-alpha-2 in the shaded jar.
[INFO] Including org.apache.maven:maven-archiver:jar:2.4.1 in the shaded jar.
[INFO] Including org.codehaus.plexus:plexus-archiver:jar:1.0 in the shaded jar.
[INFO] Including org.codehaus.plexus:plexus-io:jar:1.0 in the shaded jar.
[INFO] Including org.apache.maven.plugins:maven-clean-plugin:maven-plugin:2.4.1 in the shaded jar.
[INFO] Including commons-fileupload:commons-fileupload:jar:1.3.1 in the shaded jar.
[INFO] Including org.apache.httpcomponents:httpmime:jar:4.3.3 in the shaded jar.
[INFO] Including org.apache.commons:commons-collections4:jar:4.0 in the shaded jar.
[INFO] Including commons-configuration:commons-configuration:jar:1.7 in the shaded jar.
[INFO] Including commons-digester:commons-digester:jar:1.8.1 in the shaded jar.
[INFO] Including commons-beanutils:commons-beanutils:jar:1.9.2 in the shaded jar.
[INFO] Including org.apache.httpcomponents:httpclient:jar:4.3.6 in the shaded jar.
[INFO] Including org.apache.httpcomponents:httpcore:jar:4.3.3 in the shaded jar.
[INFO] Including commons-logging:commons-logging:jar:1.1.3 in the shaded jar.
[INFO] Including org.apache.httpcomponents:httpclient-cache:jar:4.3.6 in the shaded jar.
[INFO] Including com.googlecode.foresite-toolkit:foresite:jar:1.0-SNAPSHOT in the shaded jar.
[INFO] Including com.hp.hpl.jena:jena:jar:2.5.5 in the shaded jar.
[INFO] Including com.hp.hpl.jena:arq:jar:2.2 in the shaded jar.
[INFO] Including org.apache.lucene:lucene-core:jar:2.2.0 in the shaded jar.
[INFO] Including com.hp.hpl.jena:arq-extra:jar:2.2 in the shaded jar.
[INFO] Including com.hp.hpl.jena:jenatest:jar:2.5.5 in the shaded jar.
[INFO] Including com.hp.hpl.jena:iri:jar:0.5 in the shaded jar.
[INFO] Including antlr:antlr:jar:2.7.5 in the shaded jar.
[INFO] Including com.hp.hpl.jena:concurrent-jena:jar:1.3.2 in the shaded jar.
[INFO] Including com.ibm.icu:icu4j:jar:3.4.4 in the shaded jar.
[INFO] Including com.hp.hpl.jena:json-jena:jar:1.0 in the shaded jar.
[INFO] Including stax:stax-api:jar:1.0 in the shaded jar.
[INFO] Including org.codehaus.woodstox:wstx-asl:jar:3.0.0 in the shaded jar.
[INFO] Including xerces:xercesImpl:jar:2.7.1 in the shaded jar.
[INFO] Including xerces:xmlParserAPIs:jar:2.0.2 in the shaded jar.
[INFO] Including rome:rome:jar:0.9 in the shaded jar.
[INFO] Including jdom:jdom:jar:1.0 in the shaded jar.
[INFO] Including xalan:xalan:jar:2.7.0 in the shaded jar.
[INFO] Including xml-apis:xml-apis:jar:1.0.b2 in the shaded jar.
[INFO] Including commons-cli:commons-cli:jar:1.0 in the shaded jar.
[INFO] Including junit:junit:jar:4.12 in the shaded jar.
[INFO] Including org.hamcrest:hamcrest-core:jar:1.3 in the shaded jar.
[INFO] Including com.nimbusds:nimbus-jose-jwt:jar:7.9 in the shaded jar.
[INFO] Including com.github.stephenc.jcip:jcip-annotations:jar:1.0-1 in the shaded jar.
[INFO] Including net.minidev:json-smart:jar:2.3 in the shaded jar.
[INFO] Including net.minidev:accessors-smart:jar:1.2 in the shaded jar.
[INFO] Including org.ow2.asm:asm:jar:5.0.4 in the shaded jar.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] xercesImpl-2.7.1.jar, xmlParserAPIs-2.0.2.jar define 1 overlapping classes: 
[WARNING]   - org.w3c.dom.html.HTMLDOMImplementation
[WARNING] maven-project-2.0.6.jar, maven-core-3.0.jar define 12 overlapping classes: 
[WARNING]   - org.apache.maven.project.ProjectSorter
[WARNING]   - org.apache.maven.project.DefaultMavenProjectHelper
[WARNING]   - org.apache.maven.project.artifact.AttachedArtifact
[WARNING]   - org.apache.maven.project.artifact.ActiveProjectArtifact
[WARNING]   - org.apache.maven.project.MavenProject
[WARNING]   - org.apache.maven.project.path.PathTranslator
[WARNING]   - org.apache.maven.project.ProjectBuildingException
[WARNING]   - org.apache.maven.project.MavenProjectHelper
[WARNING]   - org.apache.maven.project.artifact.InvalidDependencyVersionException
[WARNING]   - org.apache.maven.project.artifact.ProjectArtifactMetadata
[WARNING]   - 2 more...
[WARNING] jakarta.inject-2.6.1.jar, sisu-inject-bean-1.4.2.jar define 6 overlapping classes: 
[WARNING]   - javax.inject.Inject
[WARNING]   - javax.inject.Singleton
[WARNING]   - javax.inject.Scope
[WARNING]   - javax.inject.Named
[WARNING]   - javax.inject.Provider
[WARNING]   - javax.inject.Qualifier
[WARNING] sisu-inject-plexus-1.4.2.jar, plexus-container-default-1.0-alpha-9-stable-1.jar define 78 overlapping classes: 
[WARNING]   - org.codehaus.plexus.component.configurator.MapOrientedComponentConfigurator
[WARNING]   - org.codehaus.plexus.configuration.PlexusConfigurationException
[WARNING]   - org.codehaus.plexus.component.configurator.ComponentConfigurator
[WARNING]   - org.codehaus.plexus.component.repository.ComponentRequirement
[WARNING]   - org.codehaus.plexus.component.configurator.converters.ComponentValueSetter
[WARNING]   - org.codehaus.plexus.component.factory.AbstractComponentFactory
[WARNING]   - org.codehaus.plexus.PlexusTestCase
[WARNING]   - org.codehaus.plexus.logging.Logger
[WARNING]   - org.codehaus.plexus.component.configurator.BasicComponentConfigurator
[WARNING]   - org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException
[WARNING]   - 68 more...
[WARNING] aopalliance-repackaged-2.6.1.jar, sisu-inject-bean-1.4.2.jar define 9 overlapping classes: 
[WARNING]   - org.aopalliance.intercept.ConstructorInterceptor
[WARNING]   - org.aopalliance.intercept.MethodInvocation
[WARNING]   - org.aopalliance.intercept.MethodInterceptor
[WARNING]   - org.aopalliance.intercept.Invocation
[WARNING]   - org.aopalliance.aop.AspectException
[WARNING]   - org.aopalliance.intercept.Interceptor
[WARNING]   - org.aopalliance.intercept.Joinpoint
[WARNING]   - org.aopalliance.aop.Advice
[WARNING]   - org.aopalliance.intercept.ConstructorInvocation
[WARNING] log4j-1.2.17.jar, log4j-over-slf4j-1.7.29.jar define 29 overlapping classes: 
[WARNING]   - org.apache.log4j.spi.OptionHandler
[WARNING]   - org.apache.log4j.spi.LoggerRepository
[WARNING]   - org.apache.log4j.NDC
[WARNING]   - org.apache.log4j.PatternLayout
[WARNING]   - org.apache.log4j.LogManager
[WARNING]   - org.apache.log4j.BasicConfigurator
[WARNING]   - org.apache.log4j.spi.ErrorHandler
[WARNING]   - org.apache.log4j.MDC
[WARNING]   - org.apache.log4j.AppenderSkeleton
[WARNING]   - org.apache.log4j.WriterAppender
[WARNING]   - 19 more...
[WARNING] xmlParserAPIs-2.0.2.jar, xml-apis-1.0.b2.jar define 127 overlapping classes: 
[WARNING]   - org.xml.sax.helpers.NamespaceSupport$Context
[WARNING]   - org.xml.sax.InputSource
[WARNING]   - org.w3c.dom.html.HTMLLinkElement
[WARNING]   - org.xml.sax.ext.LexicalHandler
[WARNING]   - org.w3c.dom.ProcessingInstruction
[WARNING]   - org.w3c.dom.NamedNodeMap
[WARNING]   - org.w3c.dom.html.HTMLBodyElement
[WARNING]   - org.w3c.dom.Entity
[WARNING]   - org.xml.sax.ErrorHandler
[WARNING]   - org.w3c.dom.html.HTMLMetaElement
[WARNING]   - 117 more...
[WARNING] jcl-over-slf4j-1.7.25.jar, commons-logging-1.1.3.jar define 6 overlapping classes: 
[WARNING]   - org.apache.commons.logging.impl.SimpleLog$1
[WARNING]   - org.apache.commons.logging.Log
[WARNING]   - org.apache.commons.logging.impl.SimpleLog
[WARNING]   - org.apache.commons.logging.LogConfigurationException
[WARNING]   - org.apache.commons.logging.impl.NoOpLog
[WARNING]   - org.apache.commons.logging.LogFactory
[WARNING] classworlds-1.1-alpha-2.jar, plexus-classworlds-2.2.3.jar define 11 overlapping classes: 
[WARNING]   - org.codehaus.classworlds.DefaultClassRealm
[WARNING]   - org.codehaus.classworlds.BytesURLStreamHandler
[WARNING]   - org.codehaus.classworlds.BytesURLConnection
[WARNING]   - org.codehaus.classworlds.Launcher
[WARNING]   - org.codehaus.classworlds.NoSuchRealmException
[WARNING]   - org.codehaus.classworlds.DuplicateRealmException
[WARNING]   - org.codehaus.classworlds.ClassRealm
[WARNING]   - org.codehaus.classworlds.ClassWorld
[WARNING]   - org.codehaus.classworlds.ClassWorldException
[WARNING]   - org.codehaus.classworlds.ConfigurationException
[WARNING]   - 1 more...
[WARNING] maven-artifact-manager-2.0.6.jar, maven-core-3.0.jar define 4 overlapping classes: 
[WARNING]   - org.apache.maven.artifact.repository.metadata.AbstractRepositoryMetadata
[WARNING]   - org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata
[WARNING]   - org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager
[WARNING]   - org.apache.maven.artifact.repository.metadata.RepositoryMetadata
[WARNING] jakarta.activation-api-1.2.1.jar, activation-1.1.jar, javax.activation-api-1.2.0.jar define 27 overlapping classes: 
[WARNING]   - javax.activation.ObjectDataContentHandler
[WARNING]   - javax.activation.DataContentHandlerFactory
[WARNING]   - javax.activation.DataContentHandler
[WARNING]   - javax.activation.CommandObject
[WARNING]   - javax.activation.SecuritySupport$2
[WARNING]   - javax.activation.FileTypeMap
[WARNING]   - javax.activation.CommandInfo
[WARNING]   - javax.activation.MailcapCommandMap
[WARNING]   - javax.activation.DataHandler$1
[WARNING]   - javax.activation.UnsupportedDataTypeException
[WARNING]   - 17 more...
[WARNING] jakarta.xml.bind-api-2.3.2.jar, jaxb-api-2.3.1.jar define 111 overlapping classes: 
[WARNING]   - javax.xml.bind.annotation.XmlValue
[WARNING]   - javax.xml.bind.annotation.XmlElement
[WARNING]   - javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
[WARNING]   - javax.xml.bind.ContextFinder
[WARNING]   - javax.xml.bind.ContextFinder$3
[WARNING]   - javax.xml.bind.annotation.XmlElementRefs
[WARNING]   - javax.xml.bind.helpers.DefaultValidationEventHandler
[WARNING]   - javax.xml.bind.ParseConversionEvent
[WARNING]   - javax.xml.bind.annotation.XmlSchema
[WARNING]   - javax.xml.bind.ValidationException
[WARNING]   - 101 more...
[WARNING] xpp3-1.1.3.4.O.jar, stax-api-1.0.jar define 1 overlapping classes: 
[WARNING]   - javax.xml.namespace.QName
[WARNING] jakarta.activation-api-1.2.1.jar, javax.activation-api-1.2.0.jar define 4 overlapping classes: 
[WARNING]   - javax.activation.CommandInfo$Beans$1
[WARNING]   - javax.activation.MailcapCommandMap$1
[WARNING]   - javax.activation.CommandInfo$Beans
[WARNING]   - javax.activation.MimetypesFileTypeMap$1
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/bookkeeper-0.1.0-SNAPSHOT.jar with /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/bookkeeper-0.1.0-SNAPSHOT-shaded.jar
[INFO] Dependency-reduced POM written at: /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/dependency-reduced-pom.xml
[INFO] 
[INFO] --- maven-install-plugin:3.0.0-M1:install (default-install) @ bookkeeper ---
[INFO] Installing /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/bookkeeper-0.1.0-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/org/dataone/bookkeeper/0.1.0-SNAPSHOT/bookkeeper-0.1.0-SNAPSHOT.jar
[INFO] Installing /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/dependency-reduced-pom.xml to /var/lib/jenkins/.m2/repository/org/dataone/bookkeeper/0.1.0-SNAPSHOT/bookkeeper-0.1.0-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-install-plugin:3.0.0-M1:install-file (default) @ bookkeeper ---
[INFO] Installing /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/target/original-bookkeeper-0.1.0-SNAPSHOT.jar to /var/lib/jenkins/.m2/repository/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/bookkeeper-client-0.1.0-SNAPSHOT.jar
[INFO] Installing /var/lib/jenkins/jobs/bookkeeper-unstable/workspace/pom.xml to /var/lib/jenkins/.m2/repository/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/bookkeeper-client-0.1.0-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-deploy-plugin:3.0.0-M1:deploy (default-deploy) @ bookkeeper ---
[INFO] Downloading from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/maven-metadata.xml (774 B at 70 kB/s)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/bookkeeper-0.1.0-20200927.041916-21.jar
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/bookkeeper-0.1.0-20200927.041916-21.jar (49 MB at 113 MB/s)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/bookkeeper-0.1.0-20200927.041916-21.pom
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/bookkeeper-0.1.0-20200927.041916-21.pom (11 kB at 11 MB/s)
[INFO] Downloading from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/maven-metadata.xml
[INFO] Downloaded from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/maven-metadata.xml (319 B at 319 kB/s)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/maven-metadata.xml
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/0.1.0-SNAPSHOT/maven-metadata.xml (774 B at 774 kB/s)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/maven-metadata.xml
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper/maven-metadata.xml (319 B at 319 kB/s)
[INFO] 
[INFO] --- maven-deploy-plugin:3.0.0-M1:deploy-file (deploy-file) @ bookkeeper ---
[INFO] Downloading from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/maven-metadata.xml (781 B at 781 kB/s)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/bookkeeper-client-0.1.0-20200927.041916-21.jar
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/bookkeeper-client-0.1.0-20200927.041916-21.jar (102 kB at 51 MB/s)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/bookkeeper-client-0.1.0-20200927.041916-21.pom
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/bookkeeper-client-0.1.0-20200927.041916-21.pom (13 kB at 13 MB/s)
[INFO] Downloading from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/maven-metadata.xml
[INFO] Downloaded from jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/maven-metadata.xml (326 B at 326 kB/s)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/maven-metadata.xml
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/0.1.0-SNAPSHOT/maven-metadata.xml (781 B)
[INFO] Uploading to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/maven-metadata.xml
[INFO] Uploaded to jenkins.dataone.org: file:///var/www/maven/org/dataone/bookkeeper-client/maven-metadata.xml (326 B at 326 kB/s)
Notifying upstream projects of job completion
Join notifier requires a CauseAction
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.872 s
[INFO] Finished at: 2020-09-27T04:19:17Z
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data