(427.3ms) CREATE DATABASE "disco_app" ENCODING = 'unicode'  (299.9ms) CREATE DATABASE "disco_app_test" ENCODING = 'unicode'  (14.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (8.2ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp(6) NOT NULL, "updated_at" timestamp(6) NOT NULL)  (0.8ms) SELECT pg_try_advisory_lock(6817286569990567965)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateShopsIfNotExistent (20150525000000)  (0.7ms) BEGIN  (0.8ms) DROP TABLE IF EXISTS "disco_app_app_settings" CASCADE  (4.2ms) CREATE TABLE "disco_app_app_settings" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.2ms) DROP TABLE IF EXISTS "disco_app_application_charges" CASCADE  (3.9ms) CREATE TABLE "disco_app_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (0.3ms) DROP TABLE IF EXISTS "disco_app_plan_codes" CASCADE  (5.7ms) CREATE TABLE "disco_app_plan_codes" ("id" bigserial primary key, "plan_id" bigint, "code" character varying, "trial_period_days" integer, "amount" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0)  (0.2ms) DROP TABLE IF EXISTS "disco_app_plans" CASCADE  (4.4ms) CREATE TABLE "disco_app_plans" ("id" bigserial primary key, "status" integer DEFAULT 0, "name" character varying, "plan_type" integer DEFAULT 0, "trial_period_days" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "amount" integer DEFAULT 0, "currency" character varying DEFAULT 'USD', "interval" integer DEFAULT 0, "interval_count" integer DEFAULT 1)  (0.2ms) DROP TABLE IF EXISTS "disco_app_recurring_application_charges" CASCADE  (3.5ms) CREATE TABLE "disco_app_recurring_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (0.3ms) DROP TABLE IF EXISTS "disco_app_sessions" CASCADE  (3.6ms) CREATE TABLE "disco_app_sessions" ("id" bigserial primary key, "session_id" character varying NOT NULL, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shop_id" integer)  (1.1ms) CREATE UNIQUE INDEX "index_disco_app_sessions_on_session_id" ON "disco_app_sessions" USING btree ("session_id")  (1.2ms) CREATE INDEX "index_disco_app_sessions_on_updated_at" ON "disco_app_sessions" USING btree ("updated_at")  (0.2ms) DROP TABLE IF EXISTS "disco_app_shops" CASCADE  (3.9ms) CREATE TABLE "disco_app_shops" ("id" bigserial primary key, "shopify_domain" character varying NOT NULL, "shopify_token" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0, "domain" character varying, "plan_name" character varying, "name" character varying, "data" jsonb DEFAULT '{}')  (1.0ms) CREATE UNIQUE INDEX "index_disco_app_shops_on_shopify_domain" ON "disco_app_shops" USING btree ("shopify_domain")  (0.3ms) DROP TABLE IF EXISTS "disco_app_subscriptions" CASCADE  (8.2ms) CREATE TABLE "disco_app_subscriptions" ("id" bigserial primary key, "shop_id" integer, "plan_id" integer, "status" integer, "subscription_type" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "trial_start_at" timestamp, "trial_end_at" timestamp, "cancelled_at" timestamp, "amount" integer DEFAULT 0, "plan_code_id" bigint, "source" character varying, "trial_period_days" integer)  (3.4ms) CREATE INDEX "index_disco_app_subscriptions_on_plan_id" ON "disco_app_subscriptions" USING btree ("plan_id")  (2.3ms) CREATE INDEX "index_disco_app_subscriptions_on_shop_id" ON "disco_app_subscriptions" USING btree ("shop_id")  (4.3ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_0db59d7de6" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (5.2ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_2a78d31722" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (3.6ms) ALTER TABLE "disco_app_plan_codes" ADD CONSTRAINT "fk_rails_d0a909a853" FOREIGN KEY ("plan_id") REFERENCES "disco_app_plans" ("id")   (5.2ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_be8ecf206c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (2.0ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_e1ff4c71cc" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (5.8ms) ALTER TABLE "disco_app_sessions" ADD CONSTRAINT "fk_rails_babbf55f7d" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (2.2ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_a96be2a4bb" FOREIGN KEY ("plan_code_id") REFERENCES "disco_app_plan_codes" ("id")  primary::SchemaMigration Create (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ('20150525000000') RETURNING "version"  (1.7ms) COMMIT Migrating to CreateProducts (20160307182229)  (1.1ms) BEGIN  (3.5ms) CREATE TABLE "products" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.5ms) ALTER TABLE "products" ADD CONSTRAINT "fk_rails_b169a26347" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")  primary::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20160307182229') RETURNING "version"  (0.5ms) COMMIT Migrating to CreateAssetModels (20160530160739)  (0.3ms) BEGIN  (5.3ms) CREATE TABLE "js_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en')  (2.9ms) CREATE TABLE "widget_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en', "background_color" character varying DEFAULT '#FFFFFF')  (1.4ms) ALTER TABLE "js_configurations" ADD CONSTRAINT "fk_rails_3d59259642" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (1.4ms) ALTER TABLE "widget_configurations" ADD CONSTRAINT "fk_rails_d4f17b6c5c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")  primary::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20160530160739') RETURNING "version"  (1.4ms) COMMIT Migrating to CreateCarts (20161105054746)  (0.7ms) BEGIN  (3.7ms) CREATE TABLE "carts" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "token" character varying, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.4ms) ALTER TABLE "carts" ADD CONSTRAINT "fk_rails_faed68a831" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (5.4ms) CREATE UNIQUE INDEX "index_carts_on_token" ON "carts" ("token") primary::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ('20161105054746') RETURNING "version"  (0.6ms) COMMIT Migrating to CreateDiscoAppSources (20170315062548)  (7.8ms) BEGIN  (5.9ms) CREATE TABLE "disco_app_sources" ("id" bigserial primary key, "source" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.8ms) CREATE INDEX "index_disco_app_sources_on_source" ON "disco_app_sources" ("source") primary::SchemaMigration Create (1.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170315062548') RETURNING "version"  (0.7ms) COMMIT Migrating to AddSourcesToShopSubscriptions (20170315062629)  (1.2ms) BEGIN  (1.4ms) ALTER TABLE "disco_app_subscriptions" ADD "source_id" bigint  (2.5ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_baa4cade5a" FOREIGN KEY ("source_id") REFERENCES "disco_app_sources" ("id")  DiscoApp::Subscription Load (0.6ms) SELECT "disco_app_subscriptions".* FROM "disco_app_subscriptions" WHERE "disco_app_subscriptions"."source_id" IS NOT NULL ORDER BY "disco_app_subscriptions"."id" ASC LIMIT 1000  (0.7ms) ALTER TABLE "disco_app_subscriptions" DROP COLUMN "source" primary::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170315062629') RETURNING "version"  (0.4ms) COMMIT Migrating to CreateDiscoAppUsers (20170327214540)  (0.2ms) BEGIN  (3.5ms) CREATE TABLE "disco_app_users" ("id" bigserial primary key, "shop_id" bigint, "first_name" character varying, "last_name" character varying, "email" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) CREATE UNIQUE INDEX "index_disco_app_users_on_shop_id" ON "disco_app_users" ("shop_id") primary::SchemaMigration Create (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170327214540') RETURNING "version"  (1.2ms) COMMIT Migrating to FixDiscoAppUsersIndex (20170606160751)  (0.5ms) BEGIN  (0.8ms) DROP INDEX "index_disco_app_users_on_shop_id"  (1.2ms) CREATE UNIQUE INDEX "index_disco_app_users_on_id_and_shop_id" ON "disco_app_users" ("id", "shop_id") primary::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170606160751') RETURNING "version"  (0.9ms) COMMIT Migrating to CreateFlowActionsAndTriggers (20181229100327)  (0.2ms) BEGIN  (6.0ms) CREATE TABLE "disco_app_flow_actions" ("id" bigserial primary key, "shop_id" bigint, "action_id" character varying, "action_run_id" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE TABLE "disco_app_flow_triggers" ("id" bigserial primary key, "shop_id" bigint, "title" character varying, "resource_name" character varying, "resource_url" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.8ms) ALTER TABLE "disco_app_flow_actions" ADD CONSTRAINT "fk_rails_4640aa9452" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (3.1ms) ALTER TABLE "disco_app_flow_triggers" ADD CONSTRAINT "fk_rails_2e38b229ab" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (1.5ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_action_run_id" ON "disco_app_flow_actions" ("action_run_id") primary::SchemaMigration Create (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ('20181229100327') RETURNING "version"  (0.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1  (0.2ms) BEGIN ActiveRecord::InternalMetadata Create (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('environment', 'development', '2020-04-04 06:28:28.792729', '2020-04-04 06:28:28.792729') RETURNING "key"  (0.6ms) COMMIT  (0.5ms) SELECT pg_advisory_unlock(6817286569990567965)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT pg_try_advisory_lock(6817286569990567965)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateFlowTriggerUsages (20200405000000)  (0.2ms) BEGIN  (10.9ms) CREATE TABLE "disco_app_flow_trigger_usages" ("id" bigserial primary key, "shop_id" bigint, "flow_trigger_definition_id" character varying, "has_enabled_flow" boolean DEFAULT TRUE, "timestamp" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) ALTER TABLE "disco_app_flow_trigger_usages" ADD CONSTRAINT "fk_rails_4ba3703eb3" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (2.4ms) ROLLBACK  (0.2ms) SELECT pg_advisory_unlock(6817286569990567965)  (0.2ms) SELECT pg_try_advisory_lock(6817286569990567965)  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateFlowTriggerUsages (20200405000000)  (0.2ms) BEGIN  (3.3ms) CREATE TABLE "disco_app_flow_trigger_usages" ("id" bigserial primary key, "shop_id" bigint, "flow_trigger_definition_id" character varying, "has_enabled_flow" boolean DEFAULT TRUE, "timestamp" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) ALTER TABLE "disco_app_flow_trigger_usages" ADD CONSTRAINT "fk_rails_4ba3703eb3" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (3.8ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_shop_id_and_trigger_id" ON "disco_app_flow_actions" ("shop_id", "flow_trigger_definition_id")  (0.2ms) ROLLBACK  (0.2ms) SELECT pg_advisory_unlock(6817286569990567965)  (0.2ms) SELECT pg_try_advisory_lock(6817286569990567965)  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateFlowTriggerUsages (20200405000000)  (0.2ms) BEGIN  (3.4ms) CREATE TABLE "disco_app_flow_trigger_usages" ("id" bigserial primary key, "shop_id" bigint, "flow_trigger_definition_id" character varying, "has_enabled_flow" boolean DEFAULT TRUE, "timestamp" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.1ms) ALTER TABLE "disco_app_flow_trigger_usages" ADD CONSTRAINT "fk_rails_4ba3703eb3" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (1.4ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_shop_id_and_trigger_id" ON "disco_app_flow_trigger_usages" ("shop_id", "flow_trigger_definition_id") primary::SchemaMigration Create (1.9ms) INSERT INTO "schema_migrations" ("version") VALUES ('20200405000000') RETURNING "version"  (0.4ms) COMMIT ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1  (0.2ms) SELECT pg_advisory_unlock(6817286569990567965)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (320.3ms) CREATE DATABASE "disco_app" ENCODING = 'unicode'  (245.5ms) CREATE DATABASE "disco_app_test" ENCODING = 'unicode'  (8.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.1ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp(6) NOT NULL, "updated_at" timestamp(6) NOT NULL)  (0.1ms) SELECT pg_try_advisory_lock(6817286569990567965)  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateShopsIfNotExistent (20150525000000)  (0.1ms) BEGIN  (0.5ms) DROP TABLE IF EXISTS "disco_app_app_settings" CASCADE  (2.7ms) CREATE TABLE "disco_app_app_settings" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.1ms) DROP TABLE IF EXISTS "disco_app_application_charges" CASCADE  (2.2ms) CREATE TABLE "disco_app_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (0.1ms) DROP TABLE IF EXISTS "disco_app_plan_codes" CASCADE  (1.8ms) CREATE TABLE "disco_app_plan_codes" ("id" bigserial primary key, "plan_id" bigint, "code" character varying, "trial_period_days" integer, "amount" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0)  (0.1ms) DROP TABLE IF EXISTS "disco_app_plans" CASCADE  (2.0ms) CREATE TABLE "disco_app_plans" ("id" bigserial primary key, "status" integer DEFAULT 0, "name" character varying, "plan_type" integer DEFAULT 0, "trial_period_days" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "amount" integer DEFAULT 0, "currency" character varying DEFAULT 'USD', "interval" integer DEFAULT 0, "interval_count" integer DEFAULT 1)  (0.1ms) DROP TABLE IF EXISTS "disco_app_recurring_application_charges" CASCADE  (1.9ms) CREATE TABLE "disco_app_recurring_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (0.1ms) DROP TABLE IF EXISTS "disco_app_sessions" CASCADE  (1.9ms) CREATE TABLE "disco_app_sessions" ("id" bigserial primary key, "session_id" character varying NOT NULL, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shop_id" integer)  (0.5ms) CREATE UNIQUE INDEX "index_disco_app_sessions_on_session_id" ON "disco_app_sessions" USING btree ("session_id")  (0.8ms) CREATE INDEX "index_disco_app_sessions_on_updated_at" ON "disco_app_sessions" USING btree ("updated_at")  (0.1ms) DROP TABLE IF EXISTS "disco_app_shops" CASCADE  (2.2ms) CREATE TABLE "disco_app_shops" ("id" bigserial primary key, "shopify_domain" character varying NOT NULL, "shopify_token" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0, "domain" character varying, "plan_name" character varying, "name" character varying, "data" jsonb DEFAULT '{}')  (0.5ms) CREATE UNIQUE INDEX "index_disco_app_shops_on_shopify_domain" ON "disco_app_shops" USING btree ("shopify_domain")  (0.1ms) DROP TABLE IF EXISTS "disco_app_subscriptions" CASCADE  (1.6ms) CREATE TABLE "disco_app_subscriptions" ("id" bigserial primary key, "shop_id" integer, "plan_id" integer, "status" integer, "subscription_type" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "trial_start_at" timestamp, "trial_end_at" timestamp, "cancelled_at" timestamp, "amount" integer DEFAULT 0, "plan_code_id" bigint, "source" character varying, "trial_period_days" integer)  (0.5ms) CREATE INDEX "index_disco_app_subscriptions_on_plan_id" ON "disco_app_subscriptions" USING btree ("plan_id")  (0.5ms) CREATE INDEX "index_disco_app_subscriptions_on_shop_id" ON "disco_app_subscriptions" USING btree ("shop_id")  (2.0ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_0db59d7de6" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.9ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_2a78d31722" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (0.7ms) ALTER TABLE "disco_app_plan_codes" ADD CONSTRAINT "fk_rails_d0a909a853" FOREIGN KEY ("plan_id") REFERENCES "disco_app_plans" ("id")   (0.5ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_be8ecf206c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.5ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_e1ff4c71cc" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (0.9ms) ALTER TABLE "disco_app_sessions" ADD CONSTRAINT "fk_rails_babbf55f7d" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.8ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_a96be2a4bb" FOREIGN KEY ("plan_code_id") REFERENCES "disco_app_plan_codes" ("id")  primary::SchemaMigration Create (1.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20150525000000') RETURNING "version"  (0.6ms) COMMIT Migrating to CreateProducts (20160307182229)  (0.6ms) BEGIN  (1.8ms) CREATE TABLE "products" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) ALTER TABLE "products" ADD CONSTRAINT "fk_rails_b169a26347" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")  primary::SchemaMigration Create (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20160307182229') RETURNING "version"  (0.3ms) COMMIT Migrating to CreateAssetModels (20160530160739)  (0.2ms) BEGIN  (1.7ms) CREATE TABLE "js_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en')  (2.1ms) CREATE TABLE "widget_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en', "background_color" character varying DEFAULT '#FFFFFF')  (0.5ms) ALTER TABLE "js_configurations" ADD CONSTRAINT "fk_rails_3d59259642" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.5ms) ALTER TABLE "widget_configurations" ADD CONSTRAINT "fk_rails_d4f17b6c5c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")  primary::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20160530160739') RETURNING "version"  (0.2ms) COMMIT Migrating to CreateCarts (20161105054746)  (0.2ms) BEGIN  (1.6ms) CREATE TABLE "carts" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "token" character varying, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) ALTER TABLE "carts" ADD CONSTRAINT "fk_rails_faed68a831" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.7ms) CREATE UNIQUE INDEX "index_carts_on_token" ON "carts" ("token") primary::SchemaMigration Create (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20161105054746') RETURNING "version"  (0.3ms) COMMIT Migrating to CreateDiscoAppSources (20170315062548)  (0.2ms) BEGIN  (1.8ms) CREATE TABLE "disco_app_sources" ("id" bigserial primary key, "source" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.4ms) CREATE INDEX "index_disco_app_sources_on_source" ON "disco_app_sources" ("source") primary::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170315062548') RETURNING "version"  (0.2ms) COMMIT Migrating to AddSourcesToShopSubscriptions (20170315062629)  (0.2ms) BEGIN  (0.5ms) ALTER TABLE "disco_app_subscriptions" ADD "source_id" bigint  (0.7ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_baa4cade5a" FOREIGN KEY ("source_id") REFERENCES "disco_app_sources" ("id")  DiscoApp::Subscription Load (0.3ms) SELECT "disco_app_subscriptions".* FROM "disco_app_subscriptions" WHERE "disco_app_subscriptions"."source_id" IS NOT NULL ORDER BY "disco_app_subscriptions"."id" ASC LIMIT 1000  (1.0ms) ALTER TABLE "disco_app_subscriptions" DROP COLUMN "source" primary::SchemaMigration Create (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170315062629') RETURNING "version"  (0.4ms) COMMIT Migrating to CreateDiscoAppUsers (20170327214540)  (0.1ms) BEGIN  (2.2ms) CREATE TABLE "disco_app_users" ("id" bigserial primary key, "shop_id" bigint, "first_name" character varying, "last_name" character varying, "email" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) CREATE UNIQUE INDEX "index_disco_app_users_on_shop_id" ON "disco_app_users" ("shop_id") primary::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170327214540') RETURNING "version"  (0.3ms) COMMIT Migrating to FixDiscoAppUsersIndex (20170606160751)  (0.2ms) BEGIN  (0.3ms) DROP INDEX "index_disco_app_users_on_shop_id"  (0.5ms) CREATE UNIQUE INDEX "index_disco_app_users_on_id_and_shop_id" ON "disco_app_users" ("id", "shop_id") primary::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20170606160751') RETURNING "version"  (0.7ms) COMMIT Migrating to CreateFlowActionsAndTriggers (20181229100327)  (0.1ms) BEGIN  (1.8ms) CREATE TABLE "disco_app_flow_actions" ("id" bigserial primary key, "shop_id" bigint, "action_id" character varying, "action_run_id" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.6ms) CREATE TABLE "disco_app_flow_triggers" ("id" bigserial primary key, "shop_id" bigint, "title" character varying, "resource_name" character varying, "resource_url" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) ALTER TABLE "disco_app_flow_actions" ADD CONSTRAINT "fk_rails_4640aa9452" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.7ms) ALTER TABLE "disco_app_flow_triggers" ADD CONSTRAINT "fk_rails_2e38b229ab" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.6ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_action_run_id" ON "disco_app_flow_actions" ("action_run_id") primary::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20181229100327') RETURNING "version"  (0.3ms) COMMIT Migrating to CreateFlowTriggerUsages (20200405000000)  (0.2ms) BEGIN  (1.9ms) CREATE TABLE "disco_app_flow_trigger_usages" ("id" bigserial primary key, "shop_id" bigint, "flow_trigger_definition_id" character varying, "has_enabled_flow" boolean DEFAULT TRUE, "timestamp" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) ALTER TABLE "disco_app_flow_trigger_usages" ADD CONSTRAINT "fk_rails_4ba3703eb3" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.5ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_shop_id_and_trigger_id" ON "disco_app_flow_trigger_usages" ("shop_id", "flow_trigger_definition_id") primary::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20200405000000') RETURNING "version"  (0.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1  (0.1ms) BEGIN ActiveRecord::InternalMetadata Create (0.6ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('environment', 'development', '2020-04-20 06:08:51.767930', '2020-04-20 06:08:51.767930') RETURNING "key"  (0.2ms) COMMIT  (0.1ms) SELECT pg_advisory_unlock(6817286569990567965)  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment'  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment'  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' SQL (1.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (13.8ms) DROP TABLE IF EXISTS "carts" CASCADE  (11.2ms) CREATE TABLE "carts" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "token" character varying, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) CREATE UNIQUE INDEX "index_carts_on_token" ON "carts" ("token")  (1.7ms) DROP TABLE IF EXISTS "disco_app_app_settings" CASCADE  (1.4ms) CREATE TABLE "disco_app_app_settings" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.5ms) DROP TABLE IF EXISTS "disco_app_application_charges" CASCADE  (2.3ms) CREATE TABLE "disco_app_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (1.8ms) DROP TABLE IF EXISTS "disco_app_flow_actions" CASCADE  (2.2ms) CREATE TABLE "disco_app_flow_actions" ("id" bigserial primary key, "shop_id" bigint, "action_id" character varying, "action_run_id" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_action_run_id" ON "disco_app_flow_actions" ("action_run_id")  (1.7ms) DROP TABLE IF EXISTS "disco_app_flow_trigger_usages" CASCADE  (2.2ms) CREATE TABLE "disco_app_flow_trigger_usages" ("id" bigserial primary key, "shop_id" bigint, "flow_trigger_definition_id" character varying, "has_enabled_flow" boolean DEFAULT TRUE, "timestamp" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_shop_id_and_trigger_id" ON "disco_app_flow_trigger_usages" ("shop_id", "flow_trigger_definition_id")  (1.3ms) DROP TABLE IF EXISTS "disco_app_flow_triggers" CASCADE  (2.1ms) CREATE TABLE "disco_app_flow_triggers" ("id" bigserial primary key, "shop_id" bigint, "title" character varying, "resource_name" character varying, "resource_url" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.9ms) DROP TABLE IF EXISTS "disco_app_plan_codes" CASCADE  (1.8ms) CREATE TABLE "disco_app_plan_codes" ("id" bigserial primary key, "plan_id" bigint, "code" character varying, "trial_period_days" integer, "amount" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0)  (1.3ms) DROP TABLE IF EXISTS "disco_app_plans" CASCADE  (2.0ms) CREATE TABLE "disco_app_plans" ("id" bigserial primary key, "status" integer DEFAULT 0, "name" character varying, "plan_type" integer DEFAULT 0, "trial_period_days" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "amount" integer DEFAULT 0, "currency" character varying DEFAULT 'USD', "interval" integer DEFAULT 0, "interval_count" integer DEFAULT 1)  (1.4ms) DROP TABLE IF EXISTS "disco_app_recurring_application_charges" CASCADE  (2.1ms) CREATE TABLE "disco_app_recurring_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (1.4ms) DROP TABLE IF EXISTS "disco_app_sessions" CASCADE  (2.6ms) CREATE TABLE "disco_app_sessions" ("id" bigserial primary key, "session_id" character varying NOT NULL, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shop_id" integer)  (0.6ms) CREATE UNIQUE INDEX "index_disco_app_sessions_on_session_id" ON "disco_app_sessions" ("session_id")  (0.6ms) CREATE INDEX "index_disco_app_sessions_on_updated_at" ON "disco_app_sessions" ("updated_at")  (1.7ms) DROP TABLE IF EXISTS "disco_app_shops" CASCADE  (1.8ms) CREATE TABLE "disco_app_shops" ("id" bigserial primary key, "shopify_domain" character varying NOT NULL, "shopify_token" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0, "domain" character varying, "plan_name" character varying, "name" character varying, "data" jsonb DEFAULT '{}')  (1.0ms) CREATE UNIQUE INDEX "index_disco_app_shops_on_shopify_domain" ON "disco_app_shops" ("shopify_domain")  (1.2ms) DROP TABLE IF EXISTS "disco_app_sources" CASCADE  (1.9ms) CREATE TABLE "disco_app_sources" ("id" bigserial primary key, "source" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) CREATE INDEX "index_disco_app_sources_on_source" ON "disco_app_sources" ("source")  (1.3ms) DROP TABLE IF EXISTS "disco_app_subscriptions" CASCADE  (1.2ms) CREATE TABLE "disco_app_subscriptions" ("id" bigserial primary key, "shop_id" integer, "plan_id" integer, "status" integer, "subscription_type" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "trial_start_at" timestamp, "trial_end_at" timestamp, "cancelled_at" timestamp, "amount" integer DEFAULT 0, "plan_code_id" bigint, "trial_period_days" integer, "source_id" bigint)  (0.7ms) CREATE INDEX "index_disco_app_subscriptions_on_plan_id" ON "disco_app_subscriptions" ("plan_id")  (0.5ms) CREATE INDEX "index_disco_app_subscriptions_on_shop_id" ON "disco_app_subscriptions" ("shop_id")  (1.1ms) DROP TABLE IF EXISTS "disco_app_users" CASCADE  (1.7ms) CREATE TABLE "disco_app_users" ("id" bigserial primary key, "shop_id" bigint, "first_name" character varying, "last_name" character varying, "email" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) CREATE UNIQUE INDEX "index_disco_app_users_on_id_and_shop_id" ON "disco_app_users" ("id", "shop_id")  (1.1ms) DROP TABLE IF EXISTS "js_configurations" CASCADE  (2.2ms) CREATE TABLE "js_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en')  (1.0ms) DROP TABLE IF EXISTS "products" CASCADE  (1.9ms) CREATE TABLE "products" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.5ms) DROP TABLE IF EXISTS "widget_configurations" CASCADE  (2.8ms) CREATE TABLE "widget_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en', "background_color" character varying DEFAULT '#FFFFFF')  (2.3ms) ALTER TABLE "carts" ADD CONSTRAINT "fk_rails_faed68a831" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.8ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_0db59d7de6" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.8ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_2a78d31722" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (0.7ms) ALTER TABLE "disco_app_flow_actions" ADD CONSTRAINT "fk_rails_4640aa9452" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.7ms) ALTER TABLE "disco_app_flow_trigger_usages" ADD CONSTRAINT "fk_rails_4ba3703eb3" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.9ms) ALTER TABLE "disco_app_flow_triggers" ADD CONSTRAINT "fk_rails_2e38b229ab" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.7ms) ALTER TABLE "disco_app_plan_codes" ADD CONSTRAINT "fk_rails_d0a909a853" FOREIGN KEY ("plan_id") REFERENCES "disco_app_plans" ("id")   (0.6ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_be8ecf206c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.6ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_e1ff4c71cc" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (1.0ms) ALTER TABLE "disco_app_sessions" ADD CONSTRAINT "fk_rails_babbf55f7d" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.5ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_a96be2a4bb" FOREIGN KEY ("plan_code_id") REFERENCES "disco_app_plan_codes" ("id")   (0.6ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_baa4cade5a" FOREIGN KEY ("source_id") REFERENCES "disco_app_sources" ("id")   (0.9ms) ALTER TABLE "js_configurations" ADD CONSTRAINT "fk_rails_3d59259642" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.6ms) ALTER TABLE "products" ADD CONSTRAINT "fk_rails_b169a26347" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.6ms) ALTER TABLE "widget_configurations" ADD CONSTRAINT "fk_rails_d4f17b6c5c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1 ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1 ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'schema_sha1' LIMIT 1  (0.1ms) BEGIN ActiveRecord::InternalMetadata Create (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('schema_sha1', '5bb50317d3c60a11fb2b4e520fa3246f0e5d7b44', '2021-01-04 04:13:31.958144', '2021-01-04 04:13:31.958144') RETURNING "key"  (0.2ms) COMMIT SQL (1.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (6.5ms) DROP TABLE IF EXISTS "carts" CASCADE  (8.9ms) CREATE TABLE "carts" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "token" character varying, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) CREATE UNIQUE INDEX "index_carts_on_token" ON "carts" ("token")  (0.9ms) DROP TABLE IF EXISTS "disco_app_app_settings" CASCADE  (1.2ms) CREATE TABLE "disco_app_app_settings" ("id" bigserial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) DROP TABLE IF EXISTS "disco_app_application_charges" CASCADE  (2.1ms) CREATE TABLE "disco_app_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (2.7ms) DROP TABLE IF EXISTS "disco_app_flow_actions" CASCADE  (2.3ms) CREATE TABLE "disco_app_flow_actions" ("id" bigserial primary key, "shop_id" bigint, "action_id" character varying, "action_run_id" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_action_run_id" ON "disco_app_flow_actions" ("action_run_id")  (1.8ms) DROP TABLE IF EXISTS "disco_app_flow_trigger_usages" CASCADE  (2.3ms) CREATE TABLE "disco_app_flow_trigger_usages" ("id" bigserial primary key, "shop_id" bigint, "flow_trigger_definition_id" character varying, "has_enabled_flow" boolean DEFAULT TRUE, "timestamp" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_shop_id_and_trigger_id" ON "disco_app_flow_trigger_usages" ("shop_id", "flow_trigger_definition_id")  (1.8ms) DROP TABLE IF EXISTS "disco_app_flow_triggers" CASCADE  (1.8ms) CREATE TABLE "disco_app_flow_triggers" ("id" bigserial primary key, "shop_id" bigint, "title" character varying, "resource_name" character varying, "resource_url" character varying, "properties" jsonb DEFAULT '{}', "status" integer DEFAULT 0, "processed_at" timestamp, "processing_errors" jsonb DEFAULT '[]', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.0ms) DROP TABLE IF EXISTS "disco_app_plan_codes" CASCADE  (2.2ms) CREATE TABLE "disco_app_plan_codes" ("id" bigserial primary key, "plan_id" bigint, "code" character varying, "trial_period_days" integer, "amount" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0)  (2.0ms) DROP TABLE IF EXISTS "disco_app_plans" CASCADE  (2.2ms) CREATE TABLE "disco_app_plans" ("id" bigserial primary key, "status" integer DEFAULT 0, "name" character varying, "plan_type" integer DEFAULT 0, "trial_period_days" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "amount" integer DEFAULT 0, "currency" character varying DEFAULT 'USD', "interval" integer DEFAULT 0, "interval_count" integer DEFAULT 1)  (1.5ms) DROP TABLE IF EXISTS "disco_app_recurring_application_charges" CASCADE  (2.1ms) CREATE TABLE "disco_app_recurring_application_charges" ("id" bigserial primary key, "shop_id" bigint, "subscription_id" bigint, "status" integer DEFAULT 0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shopify_id" bigint, "confirmation_url" character varying)  (2.2ms) DROP TABLE IF EXISTS "disco_app_sessions" CASCADE  (1.6ms) CREATE TABLE "disco_app_sessions" ("id" bigserial primary key, "session_id" character varying NOT NULL, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shop_id" integer)  (0.5ms) CREATE UNIQUE INDEX "index_disco_app_sessions_on_session_id" ON "disco_app_sessions" ("session_id")  (0.6ms) CREATE INDEX "index_disco_app_sessions_on_updated_at" ON "disco_app_sessions" ("updated_at")  (3.0ms) DROP TABLE IF EXISTS "disco_app_shops" CASCADE  (2.0ms) CREATE TABLE "disco_app_shops" ("id" bigserial primary key, "shopify_domain" character varying NOT NULL, "shopify_token" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "status" integer DEFAULT 0, "domain" character varying, "plan_name" character varying, "name" character varying, "data" jsonb DEFAULT '{}')  (0.6ms) CREATE UNIQUE INDEX "index_disco_app_shops_on_shopify_domain" ON "disco_app_shops" ("shopify_domain")  (1.3ms) DROP TABLE IF EXISTS "disco_app_sources" CASCADE  (1.8ms) CREATE TABLE "disco_app_sources" ("id" bigserial primary key, "source" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) CREATE INDEX "index_disco_app_sources_on_source" ON "disco_app_sources" ("source")  (1.2ms) DROP TABLE IF EXISTS "disco_app_subscriptions" CASCADE  (1.4ms) CREATE TABLE "disco_app_subscriptions" ("id" bigserial primary key, "shop_id" integer, "plan_id" integer, "status" integer, "subscription_type" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "trial_start_at" timestamp, "trial_end_at" timestamp, "cancelled_at" timestamp, "amount" integer DEFAULT 0, "plan_code_id" bigint, "trial_period_days" integer, "source_id" bigint)  (0.5ms) CREATE INDEX "index_disco_app_subscriptions_on_plan_id" ON "disco_app_subscriptions" ("plan_id")  (0.5ms) CREATE INDEX "index_disco_app_subscriptions_on_shop_id" ON "disco_app_subscriptions" ("shop_id")  (1.1ms) DROP TABLE IF EXISTS "disco_app_users" CASCADE  (1.7ms) CREATE TABLE "disco_app_users" ("id" bigserial primary key, "shop_id" bigint, "first_name" character varying, "last_name" character varying, "email" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) CREATE UNIQUE INDEX "index_disco_app_users_on_id_and_shop_id" ON "disco_app_users" ("id", "shop_id")  (1.7ms) DROP TABLE IF EXISTS "js_configurations" CASCADE  (1.8ms) CREATE TABLE "js_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en')  (3.2ms) DROP TABLE IF EXISTS "products" CASCADE  (1.7ms) CREATE TABLE "products" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "data" jsonb, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.7ms) DROP TABLE IF EXISTS "widget_configurations" CASCADE  (1.8ms) CREATE TABLE "widget_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en', "background_color" character varying DEFAULT '#FFFFFF')  (2.6ms) ALTER TABLE "carts" ADD CONSTRAINT "fk_rails_faed68a831" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.7ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_0db59d7de6" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.7ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_2a78d31722" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (0.7ms) ALTER TABLE "disco_app_flow_actions" ADD CONSTRAINT "fk_rails_4640aa9452" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.7ms) ALTER TABLE "disco_app_flow_trigger_usages" ADD CONSTRAINT "fk_rails_4ba3703eb3" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.6ms) ALTER TABLE "disco_app_flow_triggers" ADD CONSTRAINT "fk_rails_2e38b229ab" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.7ms) ALTER TABLE "disco_app_plan_codes" ADD CONSTRAINT "fk_rails_d0a909a853" FOREIGN KEY ("plan_id") REFERENCES "disco_app_plans" ("id")   (0.6ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_be8ecf206c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.5ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_e1ff4c71cc" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (1.7ms) ALTER TABLE "disco_app_sessions" ADD CONSTRAINT "fk_rails_babbf55f7d" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (0.7ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_a96be2a4bb" FOREIGN KEY ("plan_code_id") REFERENCES "disco_app_plan_codes" ("id")   (0.7ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_baa4cade5a" FOREIGN KEY ("source_id") REFERENCES "disco_app_sources" ("id")   (0.7ms) ALTER TABLE "js_configurations" ADD CONSTRAINT "fk_rails_3d59259642" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.6ms) ALTER TABLE "products" ADD CONSTRAINT "fk_rails_b169a26347" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.7ms) ALTER TABLE "widget_configurations" ADD CONSTRAINT "fk_rails_d4f17b6c5c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1  (0.1ms) BEGIN ActiveRecord::InternalMetadata Update (0.5ms) UPDATE "ar_internal_metadata" SET "value" = 'development', "updated_at" = '2021-01-04 04:13:32.089751' WHERE "ar_internal_metadata"."key" = 'environment'  (0.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1  (0.1ms) BEGIN ActiveRecord::InternalMetadata Update (0.1ms) UPDATE "ar_internal_metadata" SET "value" = 'test', "updated_at" = '2021-01-04 04:13:32.091951' WHERE "ar_internal_metadata"."key" = 'environment'  (0.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'schema_sha1' LIMIT 1