(0.9ms) DROP DATABASE IF EXISTS "disco_app_test"  (363.1ms) CREATE DATABASE "disco_app_test" ENCODING = 'unicode' SQL (1.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "carts" CASCADE  (10.5ms) 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.6ms) CREATE UNIQUE INDEX "index_carts_on_token" ON "carts" ("token")  (0.2ms) DROP TABLE IF EXISTS "disco_app_app_settings" CASCADE  (3.1ms) CREATE TABLE "disco_app_app_settings" ("id" serial NOT NULL PRIMARY KEY, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "disco_app_application_charges" CASCADE  (2.3ms) CREATE TABLE "disco_app_application_charges" ("id" serial NOT NULL 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.2ms) DROP TABLE IF EXISTS "disco_app_flow_actions" CASCADE  (3.4ms) 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.8ms) CREATE UNIQUE INDEX "index_disco_app_flow_actions_on_action_run_id" ON "disco_app_flow_actions" ("action_run_id")  (0.3ms) DROP TABLE IF EXISTS "disco_app_flow_triggers" CASCADE  (2.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)  (0.2ms) DROP TABLE IF EXISTS "disco_app_plan_codes" CASCADE  (2.4ms) CREATE TABLE "disco_app_plan_codes" ("id" serial NOT NULL 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  (3.2ms) CREATE TABLE "disco_app_plans" ("id" serial NOT NULL 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  (2.3ms) CREATE TABLE "disco_app_recurring_application_charges" ("id" serial NOT NULL 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.2ms) DROP TABLE IF EXISTS "disco_app_sessions" CASCADE  (2.3ms) CREATE TABLE "disco_app_sessions" ("id" serial NOT NULL PRIMARY KEY, "session_id" character varying NOT NULL, "data" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "shop_id" integer)  (1.0ms) CREATE UNIQUE INDEX "index_disco_app_sessions_on_session_id" ON "disco_app_sessions" ("session_id")  (1.2ms) CREATE INDEX "index_disco_app_sessions_on_updated_at" ON "disco_app_sessions" ("updated_at")  (0.1ms) DROP TABLE IF EXISTS "disco_app_shops" CASCADE  (2.8ms) CREATE TABLE "disco_app_shops" ("id" serial NOT NULL 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.8ms) CREATE UNIQUE INDEX "index_disco_app_shops_on_shopify_domain" ON "disco_app_shops" ("shopify_domain")  (0.2ms) DROP TABLE IF EXISTS "disco_app_sources" CASCADE  (2.0ms) CREATE TABLE "disco_app_sources" ("id" serial NOT NULL PRIMARY KEY, "source" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) CREATE INDEX "index_disco_app_sources_on_source" ON "disco_app_sources" ("source")  (0.2ms) DROP TABLE IF EXISTS "disco_app_subscriptions" CASCADE  (1.7ms) CREATE TABLE "disco_app_subscriptions" ("id" serial NOT NULL 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.6ms) CREATE INDEX "index_disco_app_subscriptions_on_plan_id" ON "disco_app_subscriptions" ("plan_id")  (0.8ms) CREATE INDEX "index_disco_app_subscriptions_on_shop_id" ON "disco_app_subscriptions" ("shop_id")  (0.2ms) DROP TABLE IF EXISTS "disco_app_users" CASCADE  (2.2ms) CREATE TABLE "disco_app_users" ("id" serial NOT NULL 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.8ms) CREATE UNIQUE INDEX "index_disco_app_users_on_id_and_shop_id" ON "disco_app_users" ("id", "shop_id")  (0.2ms) DROP TABLE IF EXISTS "js_configurations" CASCADE  (2.0ms) CREATE TABLE "js_configurations" ("id" serial NOT NULL PRIMARY KEY, "shop_id" bigint, "label" character varying DEFAULT 'Default', "locale" character varying DEFAULT 'en')  (0.2ms) DROP TABLE IF EXISTS "products" CASCADE  (2.1ms) 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.2ms) DROP TABLE IF EXISTS "widget_configurations" CASCADE  (2.5ms) 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')  (3.7ms) ALTER TABLE "carts" ADD CONSTRAINT "fk_rails_faed68a831" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (1.0ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_0db59d7de6" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (1.1ms) ALTER TABLE "disco_app_application_charges" ADD CONSTRAINT "fk_rails_2a78d31722" FOREIGN KEY ("subscription_id") REFERENCES "disco_app_subscriptions" ("id")   (1.0ms) ALTER TABLE "disco_app_flow_actions" ADD CONSTRAINT "fk_rails_4640aa9452" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (1.2ms) ALTER TABLE "disco_app_flow_triggers" ADD CONSTRAINT "fk_rails_2e38b229ab" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id") ON DELETE CASCADE  (1.4ms) ALTER TABLE "disco_app_plan_codes" ADD CONSTRAINT "fk_rails_d0a909a853" FOREIGN KEY ("plan_id") REFERENCES "disco_app_plans" ("id")   (1.0ms) ALTER TABLE "disco_app_recurring_application_charges" ADD CONSTRAINT "fk_rails_be8ecf206c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.9ms) 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  (1.0ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_a96be2a4bb" FOREIGN KEY ("plan_code_id") REFERENCES "disco_app_plan_codes" ("id")   (1.0ms) ALTER TABLE "disco_app_subscriptions" ADD CONSTRAINT "fk_rails_baa4cade5a" FOREIGN KEY ("source_id") REFERENCES "disco_app_sources" ("id")   (1.0ms) ALTER TABLE "js_configurations" ADD CONSTRAINT "fk_rails_3d59259642" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (0.9ms) ALTER TABLE "products" ADD CONSTRAINT "fk_rails_b169a26347" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (1.3ms) ALTER TABLE "widget_configurations" ADD CONSTRAINT "fk_rails_d4f17b6c5c" FOREIGN KEY ("shop_id") REFERENCES "disco_app_shops" ("id")   (1.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES (20181229100327)  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES (20160307182229), (20160530160739), (20161105054746), (20150525000000), (20170315062548), (20170315062629), (20170327214540), (20170606160751);   (1.8ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = 'environment' LIMIT 1  (0.2ms) BEGIN ActiveRecord::InternalMetadata Create (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ('environment', 'development', '2019-07-12 02:31:01.737594', '2019-07-12 02:31:01.737594') RETURNING "key"  (0.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.4ms) 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" = 'test', "updated_at" = '2019-07-12 02:31:01.743744' WHERE "ar_internal_metadata"."key" = 'environment'  (0.3ms) COMMIT