DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from at /Users/henock/projects/rails/construction/mks_auth/spec/dummy/config/initializers/new_framework_defaults.rb:21) DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from at /Users/henock/projects/rails/construction/mks_auth/spec/dummy/config/initializers/new_framework_defaults.rb:21)  (8.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (6.0ms) 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)  (0.5ms) SELECT pg_try_advisory_lock(861277768903666380)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksAuthApplicationModules (20161029065810)  (0.6ms) BEGIN  (6.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029065810"]]  (1.3ms) COMMIT Migrating to CreateMksAuthUsers (20161029065959)  (0.5ms) BEGIN  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029065959"]]  (1.9ms) COMMIT Migrating to CreateMksAuthUserRoles (20161029070807)  (0.6ms) BEGIN  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029070807"]]  (1.2ms) COMMIT Migrating to CreateMksUsersUserRoles (20161029071047)  (0.5ms) BEGIN  (1.0ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (1.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (1.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029071047"]]  (1.6ms) COMMIT Migrating to CreateMksAuthMenus (20161029072256)  (0.5ms) BEGIN  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (2.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (1.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029072256"]]  (1.6ms) COMMIT Migrating to CreateMksMenusUserRoles (20161029074023)  (0.5ms) BEGIN  (3.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (2.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (1.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (1.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029074023"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 15:54:27.250770"], ["updated_at", "2017-12-04 15:54:27.250770"]]  (1.2ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(861277768903666380)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from at /Users/henock/projects/rails/construction/mks_auth/spec/dummy/config/initializers/new_framework_defaults.rb:21)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (153.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (1440.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.3ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (19.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (64.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 15:54:41.131533"], ["updated_at", "2017-12-04 15:54:41.131533"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from at /Users/henock/projects/rails/construction/mks_auth/spec/dummy/config/initializers/new_framework_defaults.rb:21)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.8ms) DROP DATABASE IF EXISTS "mks_auth_test"  (510.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.6ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 15:54:54.381825"], ["updated_at", "2017-12-04 15:54:54.381825"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from at /Users/henock/projects/rails/construction/mks_auth/spec/dummy/config/initializers/new_framework_defaults.rb:21)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (537.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 15:58:09.957554"], ["updated_at", "2017-12-04 15:58:09.957554"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.5ms) COMMIT DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from at /Users/henock/projects/rails/construction/mks_auth/spec/dummy/config/initializers/new_framework_defaults.rb:21)  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (530.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.2ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:00:23.388463"], ["updated_at", "2017-12-04 16:00:23.388463"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT DEPRECATION WARNING: ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2. (called from at /Users/henock/projects/rails/construction/mks_auth/spec/dummy/config/initializers/new_framework_defaults.rb:21)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (485.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:08:02.817781"], ["updated_at", "2017-12-04 16:08:02.817781"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (444.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.2ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.9ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.0ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:08:34.179977"], ["updated_at", "2017-12-04 16:08:34.179977"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (520.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:13:55.839074"], ["updated_at", "2017-12-04 16:13:55.839074"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.6ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (511.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.8ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.9ms) 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 (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:23:33.607783"], ["updated_at", "2017-12-04 16:23:33.607783"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (498.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.8ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (10.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:24:01.924613"], ["updated_at", "2017-12-04 16:24:01.924613"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.7ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (475.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.2ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.0ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:29:41.714749"], ["updated_at", "2017-12-04 16:29:41.714749"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.4ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (513.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (7.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:32:31.312978"], ["updated_at", "2017-12-04 16:32:31.312978"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.5ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.8ms) DROP DATABASE IF EXISTS "mks_auth_test"  (530.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:34:50.093046"], ["updated_at", "2017-12-04 16:34:50.093046"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (453.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.9ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:34:59.706907"], ["updated_at", "2017-12-04 16:34:59.706907"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (485.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.3ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:35:28.882896"], ["updated_at", "2017-12-04 16:35:28.882896"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (484.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:36:15.532533"], ["updated_at", "2017-12-04 16:36:15.532533"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (472.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:39:02.938965"], ["updated_at", "2017-12-04 16:39:02.938965"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (474.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (3.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:43:15.271198"], ["updated_at", "2017-12-04 16:43:15.271198"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (452.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:43:42.374618"], ["updated_at", "2017-12-04 16:43:42.374618"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (215.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (453.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:44:37.652917"], ["updated_at", "2017-12-04 16:44:37.652917"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (519.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:46:23.084163"], ["updated_at", "2017-12-04 16:46:23.084163"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (501.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:47:47.765775"], ["updated_at", "2017-12-04 16:47:47.765775"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (522.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.1ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.2ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (7.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:48:04.243259"], ["updated_at", "2017-12-04 16:48:04.243259"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.8ms) DROP DATABASE IF EXISTS "mks_auth_test"  (482.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (4.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (3.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.9ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (17.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (14.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-04 16:49:02.899137"], ["updated_at", "2017-12-04 16:49:02.899137"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (452.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (8.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:43:13.206851"], ["updated_at", "2017-12-08 11:43:13.206851"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (466.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.3ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:44:34.720509"], ["updated_at", "2017-12-08 11:44:34.720509"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1851.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (479.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:45:05.246101"], ["updated_at", "2017-12-08 11:45:05.246101"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (494.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:47:39.281900"], ["updated_at", "2017-12-08 11:47:39.281900"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (556.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:48:57.820772"], ["updated_at", "2017-12-08 11:48:57.820772"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (442.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.9ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:49:53.948034"], ["updated_at", "2017-12-08 11:49:53.948034"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (494.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (9.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (8.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:51:23.137608"], ["updated_at", "2017-12-08 11:51:23.137608"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (446.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (8.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (14.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:53:03.378663"], ["updated_at", "2017-12-08 11:53:03.378663"]]  (10.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (466.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (1.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:54:24.612371"], ["updated_at", "2017-12-08 11:54:24.612371"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (460.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (15.5ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 11:54:57.533599"], ["updated_at", "2017-12-08 11:54:57.533599"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (486.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (2.9ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 12:54:09.271952"], ["updated_at", "2017-12-08 12:54:09.271952"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (443.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.4ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 13:12:55.570967"], ["updated_at", "2017-12-08 13:12:55.570967"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (469.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (5.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (13.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:08:45.025227"], ["updated_at", "2017-12-08 18:08:45.025227"]]  (9.0ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (499.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:12:40.378240"], ["updated_at", "2017-12-08 18:12:40.378240"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (473.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:13:35.498006"], ["updated_at", "2017-12-08 18:13:35.498006"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (441.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:16:12.551758"], ["updated_at", "2017-12-08 18:16:12.551758"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (440.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (15.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:18:02.617817"], ["updated_at", "2017-12-08 18:18:02.617817"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (497.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (11.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (17.2ms) 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 (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:21:22.941420"], ["updated_at", "2017-12-08 18:21:22.941420"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (432.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (1.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:22:01.470223"], ["updated_at", "2017-12-08 18:22:01.470223"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (454.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:23:29.559937"], ["updated_at", "2017-12-08 18:23:29.559937"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (136.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (995.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (19.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (98.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (10.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (18.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (29.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:24:10.404609"], ["updated_at", "2017-12-08 18:24:10.404609"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (468.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (1.1ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-08 18:28:21.332096"], ["updated_at", "2017-12-08 18:28:21.332096"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (538.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (16.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.4ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 03:58:14.422526"], ["updated_at", "2017-12-09 03:58:14.422526"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (452.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.3ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 03:59:38.475065"], ["updated_at", "2017-12-09 03:59:38.475065"]]  (13.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (473.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:00:38.604511"], ["updated_at", "2017-12-09 04:00:38.604511"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (527.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:26:33.486321"], ["updated_at", "2017-12-09 04:26:33.486321"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (429.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (14.1ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:28:51.571075"], ["updated_at", "2017-12-09 04:28:51.571075"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (352.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (451.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (7.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:29:22.738539"], ["updated_at", "2017-12-09 04:29:22.738539"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (513.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (8.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (4.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (21.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (2.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (19.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 (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:30:48.065024"], ["updated_at", "2017-12-09 04:30:48.065024"]]  (2.3ms) COMMIT ActiveRecord::InternalMetadata Load (1.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (1.0ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (489.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:31:19.425653"], ["updated_at", "2017-12-09 04:31:19.425653"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.8ms) DROP DATABASE IF EXISTS "mks_auth_test"  (495.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.3ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:32:34.576035"], ["updated_at", "2017-12-09 04:32:34.576035"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (455.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (2.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:35:15.433083"], ["updated_at", "2017-12-09 04:35:15.433083"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (461.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (12.2ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:35:34.602516"], ["updated_at", "2017-12-09 04:35:34.602516"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (451.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (1.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:36:09.149743"], ["updated_at", "2017-12-09 04:36:09.149743"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (498.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:46:54.034399"], ["updated_at", "2017-12-09 04:46:54.034399"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (489.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:47:51.663622"], ["updated_at", "2017-12-09 04:47:51.663622"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (468.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (1.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:57:10.521021"], ["updated_at", "2017-12-09 04:57:10.521021"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (450.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:58:54.516835"], ["updated_at", "2017-12-09 04:58:54.516835"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (492.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 04:59:40.504211"], ["updated_at", "2017-12-09 04:59:40.504211"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (454.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (4.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 05:03:52.126048"], ["updated_at", "2017-12-09 05:03:52.126048"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (688.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (23.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (13.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 05:04:09.959830"], ["updated_at", "2017-12-09 05:04:09.959830"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (264.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (427.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 05:04:50.415765"], ["updated_at", "2017-12-09 05:04:50.415765"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (479.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (2.8ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (2.9ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (1.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-09 05:05:55.360857"], ["updated_at", "2017-12-09 05:05:55.360857"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.4ms) BEGIN  (0.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(861277768903666380)  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksMenusUserRoles (20161029074023)  (0.5ms) BEGIN  (1.3ms) ALTER TABLE "mks_auth_menus_user_roles" DROP CONSTRAINT "fk_rails_c24fca59c0"  (1.0ms) ALTER TABLE "mks_auth_menus_user_roles" DROP CONSTRAINT "fk_rails_1807c05e36"  (0.6ms) DROP INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id"  (1.1ms) DROP TABLE "mks_auth_menus_user_roles" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161029074023"]]  (2.0ms) COMMIT Migrating to CreateMksAuthMenus (20161029072256)  (0.5ms) BEGIN  (1.0ms) ALTER TABLE "mks_auth_menus" DROP CONSTRAINT "fk_rails_e5dd25fcb5"  (0.9ms) ALTER TABLE "mks_auth_menus" DROP CONSTRAINT "fk_rails_826b2757bc"  (1.2ms) DROP TABLE "mks_auth_menus" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161029072256"]]  (2.2ms) COMMIT Migrating to CreateMksUsersUserRoles (20161029071047)  (0.6ms) BEGIN  (1.8ms) ALTER TABLE "mks_auth_users_user_roles" DROP CONSTRAINT "fk_rails_3dae904cd8"  (1.0ms) ALTER TABLE "mks_auth_users_user_roles" DROP CONSTRAINT "fk_rails_7cc19890aa"  (0.5ms) DROP INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id"  (0.7ms) DROP TABLE "mks_auth_users_user_roles" SQL (0.6ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161029071047"]]  (1.5ms) COMMIT Migrating to CreateMksAuthUserRoles (20161029070807)  (0.5ms) BEGIN  (1.2ms) DROP TABLE "mks_auth_user_roles" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161029070807"]]  (1.5ms) COMMIT Migrating to CreateMksAuthUsers (20161029065959)  (0.5ms) BEGIN  (1.0ms) ALTER TABLE "mks_auth_users" DROP CONSTRAINT "fk_rails_f959d07fb8"  (1.2ms) DROP TABLE "mks_auth_users" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161029065959"]]  (1.6ms) COMMIT Migrating to CreateMksAuthApplicationModules (20161029065810)  (0.5ms) BEGIN  (1.2ms) DROP TABLE "mks_auth_application_modules" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161029065810"]]  (2.2ms) COMMIT  (0.8ms) SELECT pg_advisory_unlock(861277768903666380)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(861277768903666380)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksAuthApplicationModules (20161029065810)  (0.6ms) BEGIN  (6.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029065810"]]  (2.1ms) COMMIT Migrating to CreateMksAuthUsers (20161029065959)  (0.5ms) BEGIN  (5.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (1.6ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")  SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029065959"]]  (1.6ms) COMMIT Migrating to CreateMksAuthUserRoles (20161029070807)  (0.5ms) BEGIN  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (1.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")  SQL (1.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029070807"]]  (1.4ms) COMMIT Migrating to CreateMksUsersUserRoles (20161029071047)  (0.6ms) BEGIN  (0.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (2.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (1.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (1.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029071047"]]  (1.5ms) COMMIT Migrating to CreateMksAuthMenus (20161029072256)  (0.5ms) BEGIN  (5.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (1.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (1.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")  SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029072256"]]  (1.4ms) COMMIT Migrating to CreateMksMenusUserRoles (20161029074023)  (0.5ms) BEGIN  (3.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (2.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (1.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (1.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20161029074023"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (0.7ms) SELECT pg_advisory_unlock(861277768903666380)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (508.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (13.7ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:18:42.394853"], ["updated_at", "2017-12-10 04:18:42.394853"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN  (0.7ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (525.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.0ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.3ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:19:23.231755"], ["updated_at", "2017-12-10 04:19:23.231755"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (425.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:20:12.585268"], ["updated_at", "2017-12-10 04:20:12.585268"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.8ms) DROP DATABASE IF EXISTS "mks_auth_test"  (456.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (2.9ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:22:13.649873"], ["updated_at", "2017-12-10 04:22:13.649873"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (489.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:24:31.327074"], ["updated_at", "2017-12-10 04:24:31.327074"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (462.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (12.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.6ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (5.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (10.8ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (6.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (32.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (9.3ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:27:52.504499"], ["updated_at", "2017-12-10 04:27:52.504499"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (463.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (14.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (9.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:28:37.509185"], ["updated_at", "2017-12-10 04:28:37.509185"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1649.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (680.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (81.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (15.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (23.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (14.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:30:05.417046"], ["updated_at", "2017-12-10 04:30:05.417046"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (413.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:34:26.790180"], ["updated_at", "2017-12-10 04:34:26.790180"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.4ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (463.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:35:02.713833"], ["updated_at", "2017-12-10 04:35:02.713833"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (459.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.9ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:35:29.134895"], ["updated_at", "2017-12-10 04:35:29.134895"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.9ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (519.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:36:29.158253"], ["updated_at", "2017-12-10 04:36:29.158253"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (515.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:36:52.049785"], ["updated_at", "2017-12-10 04:36:52.049785"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (496.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 04:37:04.498670"], ["updated_at", "2017-12-10 04:37:04.498670"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (580.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:04:03.600225"], ["updated_at", "2017-12-10 05:04:03.600225"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (537.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (12.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (22.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 (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:05:11.583948"], ["updated_at", "2017-12-10 05:05:11.583948"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (482.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:05:37.160898"], ["updated_at", "2017-12-10 05:05:37.160898"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.8ms) DROP DATABASE IF EXISTS "mks_auth_test"  (518.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (5.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.9ms) 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" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:13:12.954175"], ["updated_at", "2017-12-10 05:13:12.954175"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (467.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:14:00.140392"], ["updated_at", "2017-12-10 05:14:00.140392"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (491.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:16:33.443457"], ["updated_at", "2017-12-10 05:16:33.443457"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (118.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (461.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (1.2ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (6.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (53.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (57.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (76.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (68.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (4.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (17.7ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (8.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (5.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (30.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (22.0ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:18:14.316045"], ["updated_at", "2017-12-10 05:18:14.316045"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.6ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.5ms) DROP DATABASE IF EXISTS "mks_auth_test"  (442.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (15.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (9.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:20:55.740671"], ["updated_at", "2017-12-10 05:20:55.740671"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (500.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:21:35.923888"], ["updated_at", "2017-12-10 05:21:35.923888"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (109.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (455.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (14.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.0ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:24:20.458350"], ["updated_at", "2017-12-10 05:24:20.458350"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (475.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (2.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:25:59.461249"], ["updated_at", "2017-12-10 05:25:59.461249"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.7ms) DROP DATABASE IF EXISTS "mks_auth_test"  (514.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:27:39.662147"], ["updated_at", "2017-12-10 05:27:39.662147"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (461.1ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.0ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 05:31:11.457928"], ["updated_at", "2017-12-10 05:31:11.457928"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (510.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (7.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (59.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:31:25.771000"], ["updated_at", "2017-12-10 07:31:25.771000"]]  (15.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.7ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (445.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:33:02.609360"], ["updated_at", "2017-12-10 07:33:02.609360"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (438.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (1.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (16.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (8.1ms) 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 (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:34:18.404852"], ["updated_at", "2017-12-10 07:34:18.404852"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (427.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:35:49.251221"], ["updated_at", "2017-12-10 07:35:49.251221"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (486.6ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (9.2ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:41:12.131232"], ["updated_at", "2017-12-10 07:41:12.131232"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (461.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (13.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:42:27.673194"], ["updated_at", "2017-12-10 07:42:27.673194"]]  (1.7ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_auth_test"  (485.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (2.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:42:34.367427"], ["updated_at", "2017-12-10 07:42:34.367427"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (438.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (8.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (8.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:42:54.062484"], ["updated_at", "2017-12-10 07:42:54.062484"]]  (1.7ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (479.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.2ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:45:13.301480"], ["updated_at", "2017-12-10 07:45:13.301480"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (500.0ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:45:43.088538"], ["updated_at", "2017-12-10 07:45:43.088538"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.4ms) DROP DATABASE IF EXISTS "mks_auth_test"  (466.8ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.3ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:46:03.738192"], ["updated_at", "2017-12-10 07:46:03.738192"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (450.7ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (8.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:46:21.370946"], ["updated_at", "2017-12-10 07:46:21.370946"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (461.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (8.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (16.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:49:55.699868"], ["updated_at", "2017-12-10 07:49:55.699868"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.4ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.0ms) DROP DATABASE IF EXISTS "mks_auth_test"  (456.3ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (17.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-10 07:52:00.429493"], ["updated_at", "2017-12-10 07:52:00.429493"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.2ms) DROP DATABASE IF EXISTS "mks_auth_test"  (448.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (20.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.6ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-11 12:01:11.538822"], ["updated_at", "2017-12-11 12:01:11.538822"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.8ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (551.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.6ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-11 12:02:10.035006"], ["updated_at", "2017-12-11 12:02:10.035006"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (468.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (5.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (33.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (31.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (45.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-11 12:03:27.428564"], ["updated_at", "2017-12-11 12:03:27.428564"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.6ms) DROP DATABASE IF EXISTS "mks_auth_test"  (606.5ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.5ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.0ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.4ms) 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" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-11 12:06:45.780315"], ["updated_at", "2017-12-11 12:06:45.780315"]]  (1.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (532.4ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.4ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-11 12:10:02.546835"], ["updated_at", "2017-12-11 12:10:02.546835"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.1ms) DROP DATABASE IF EXISTS "mks_auth_test"  (542.2ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (2.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (7.9ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-11 13:48:21.850882"], ["updated_at", "2017-12-11 13:48:21.850882"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.8ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.9ms) DROP DATABASE IF EXISTS "mks_auth_test"  (509.9ms) CREATE DATABASE "mks_auth_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.2ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (28.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20161029074023)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20161029065810), (20161029065959), (20161029070807), (20161029071047), (20161029072256);   (6.3ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-11 13:52:58.597745"], ["updated_at", "2017-12-11 13:52:58.597745"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (24.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (7.0ms) 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)  (0.6ms) SELECT pg_try_advisory_lock(8195633271199295880)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 04:41:26.181383"], ["updated_at", "2017-12-16 04:41:26.181383"]]  (1.1ms) COMMIT  (0.5ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (154.9ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (457.1ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (0)  (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 04:51:22.293776"], ["updated_at", "2017-12-16 04:51:22.293776"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.7ms) COMMIT  (0.5ms) SELECT pg_try_advisory_lock(8195633271199295880)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipmentCategories (20171216041414)  (0.7ms) BEGIN  (26.1ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (2.7ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.2ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (516.9ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (10.0ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414)  (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 04:51:51.404139"], ["updated_at", "2017-12-16 04:51:51.404139"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.2ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (494.6ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (10.4ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414)  (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 04:52:59.403960"], ["updated_at", "2017-12-16 04:52:59.403960"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (2.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.8ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (562.6ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (14.0ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (8.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414)  (6.3ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 05:01:23.864483"], ["updated_at", "2017-12-16 05:01:23.864483"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.7ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.0ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (533.0ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (10.3ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414)  (5.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 05:04:51.492908"], ["updated_at", "2017-12-16 05:04:51.492908"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (499.9ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (9.6ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414)  (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 06:41:33.016491"], ["updated_at", "2017-12-16 06:41:33.016491"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (2.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.2ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (535.4ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (1.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.1ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (11.2ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414)  (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 06:41:59.379077"], ["updated_at", "2017-12-16 06:41:59.379077"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.3ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (462.6ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (10.2ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414)  (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 06:42:48.522146"], ["updated_at", "2017-12-16 06:42:48.522146"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (0.5ms) SELECT pg_try_advisory_lock(8195633271199295880)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipmentTypes (20171216064320)  (0.5ms) BEGIN  (17.4ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_types" ("equipment_category_id")  (4.9ms) ALTER TABLE "mks_equipment_equipment_types" ADD CONSTRAINT "fk_rails_fc2df45aee" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")  SQL (1.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216064320"]]  (4.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.6ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.7ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (486.6ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (10.2ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_types" ("equipment_category_id")  (4.0ms) ALTER TABLE "mks_equipment_equipment_types" ADD CONSTRAINT "fk_rails_fc2df45aee" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (7.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216064320)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 06:54:35.004691"], ["updated_at", "2017-12-16 06:54:35.004691"]]  (3.2ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.5ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (508.0ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (10.7ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_types" ("equipment_category_id")  (2.8ms) ALTER TABLE "mks_equipment_equipment_types" ADD CONSTRAINT "fk_rails_fc2df45aee" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216064320)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414);   (6.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 06:56:23.434613"], ["updated_at", "2017-12-16 06:56:23.434613"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (0.5ms) SELECT pg_try_advisory_lock(8195633271199295880)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipment (20171216070855)  (1.0ms) BEGIN  (7.7ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "equipment_on_et_indx" ON "mks_equipment_equipment" ("equipment_type_id")  (2.2ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_74408e5d48" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (2.8ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.7ms) COMMIT  (0.7ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.3ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (507.8ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (10.1ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_et_indx" ON "mks_equipment_equipment" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_types" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_74408e5d48" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_equipment_equipment_types" ADD CONSTRAINT "fk_rails_fc2df45aee" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216041414), (20171216064320);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-16 07:20:08.496894"], ["updated_at", "2017-12-16 07:20:08.496894"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(8195633271199295880)  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipment (20171216070855)  (0.8ms) BEGIN  (1.9ms) ALTER TABLE "mks_equipment_equipment" DROP CONSTRAINT "fk_rails_74408e5d48"  (1.9ms) DROP TABLE "mks_equipment_equipment" SQL (0.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (3.0ms) COMMIT Migrating to CreateMksEquipmentEquipmentTypes (20171216064320)  (0.5ms) BEGIN  (1.0ms) ALTER TABLE "mks_equipment_equipment_types" DROP CONSTRAINT "fk_rails_fc2df45aee"  (1.3ms) DROP TABLE "mks_equipment_equipment_types" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216064320"]]  (1.7ms) COMMIT Migrating to CreateMksEquipmentEquipmentCategories (20171216041414)  (1.2ms) BEGIN  (2.0ms) DROP TABLE "mks_equipment_equipment_categories" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (2.4ms) COMMIT  (1.0ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(8195633271199295880)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (7.2ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (2.6ms) COMMIT Migrating to CreateMksEquipmentEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (6.0ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (1.8ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.7ms) COMMIT Migrating to CreateMksEquipmentEquipment (20171216070855)  (0.7ms) BEGIN  (7.7ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (1.6ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.7ms) COMMIT  (1.0ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.9ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (521.4ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (9.5ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (6.7ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.8ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (2.1ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (5.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:32:55.937548"], ["updated_at", "2017-12-17 04:32:55.937548"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.3ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (647.6ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (84.3ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (42.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.8ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (65.2ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (11.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (35.1ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (19.2ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (11.0ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (97.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (4.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (21.4ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:33:21.286197"], ["updated_at", "2017-12-17 04:33:21.286197"]]  (4.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.2ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (472.6ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (10.4ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (2.2ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:38:15.416593"], ["updated_at", "2017-12-17 04:38:15.416593"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.7ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (533.8ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (10.3ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (6.3ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (2.2ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:39:13.957939"], ["updated_at", "2017-12-17 04:39:13.957939"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.6ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (521.7ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (9.8ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (6.4ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (2.4ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:40:26.575394"], ["updated_at", "2017-12-17 04:40:26.575394"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.6ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (563.0ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (9.8ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (6.4ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (2.2ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.3ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:44:11.237505"], ["updated_at", "2017-12-17 04:44:11.237505"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.4ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.9ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (442.9ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (9.6ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.8ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (2.1ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:48:03.840464"], ["updated_at", "2017-12-17 04:48:03.840464"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.6ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.0ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (528.8ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment" CASCADE  (10.2ms) CREATE TABLE "mks_equipment_equipment" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipment" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (7.9ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_equipment_equipment" ADD CONSTRAINT "fk_rails_20d0991f15" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (2.3ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 04:49:45.567547"], ["updated_at", "2017-12-17 04:49:45.567547"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT pg_try_advisory_lock(8195633271199295880)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipment (20171216070855)  (0.5ms) BEGIN  (1.4ms) ALTER TABLE "mks_equipment_equipment" DROP CONSTRAINT "fk_rails_20d0991f15"  (1.3ms) DROP TABLE "mks_equipment_equipment" SQL (0.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (3.1ms) COMMIT Migrating to CreateMksEquipmentEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (1.1ms) ALTER TABLE "mks_equipment_equipment_categories" DROP CONSTRAINT "fk_rails_1bfbc8e01e"  (1.3ms) DROP TABLE "mks_equipment_equipment_categories" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (2.1ms) COMMIT Migrating to CreateMksEquipmentEquipmentTypes (20171216024320)  (0.5ms) BEGIN  (1.3ms) DROP TABLE "mks_equipment_equipment_types" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (1.6ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT pg_try_advisory_lock(8195633271199295880)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (26.7ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (2.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (3.9ms) COMMIT Migrating to CreateMksEquipmentEquipmentCategories (20171216041414)  (0.5ms) BEGIN  (5.9ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (1.7ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.7ms) COMMIT Migrating to CreateMksEquipmentEquipments (20171216070855)  (0.6ms) BEGIN  (6.4ms) CREATE TABLE "mks_equipment_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipments" ("equipment_category_id")  (1.6ms) ALTER TABLE "mks_equipment_equipments" ADD CONSTRAINT "fk_rails_d9102a01d9" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.5ms) SELECT pg_advisory_unlock(8195633271199295880)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.0ms) DROP DATABASE IF EXISTS "mks_equipment_test"  (496.2ms) CREATE DATABASE "mks_equipment_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_equipment_equipment_categories" CASCADE  (9.5ms) CREATE TABLE "mks_equipment_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_equipment_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_equipment_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_equipment_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_equipment_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_equipment_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_equipment_equipment_categories" ADD CONSTRAINT "fk_rails_1bfbc8e01e" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_equipment_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_equipment_equipments" ADD CONSTRAINT "fk_rails_d9102a01d9" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_equipment_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.9ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 05:11:28.796491"], ["updated_at", "2017-12-17 05:11:28.796491"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.6ms) COMMIT  (9.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (6.5ms) 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)  (0.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEquipmentEquipmentTypes (20171216024320)  (0.9ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.7ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (11.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.9ms) BEGIN  (6.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.7ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 08:05:08.513794"], ["updated_at", "2017-12-17 08:05:08.513794"]]  (1.4ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (108.9ms) DROP DATABASE IF EXISTS "mks_edm_test"  (588.4ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.0ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 08:05:14.789810"], ["updated_at", "2017-12-17 08:05:14.789810"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.4ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (627.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.2ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 08:06:24.104052"], ["updated_at", "2017-12-17 08:06:24.104052"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.9ms) DROP DATABASE IF EXISTS "mks_edm_test"  (550.4ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (6.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 08:07:22.514900"], ["updated_at", "2017-12-17 08:07:22.514900"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (556.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (7.2ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-17 08:08:02.018300"], ["updated_at", "2017-12-17 08:08:02.018300"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (1042.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (200.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (92.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (66.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (598.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (59.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (6.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (44.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (13.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (4.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216070855)  (3.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414);   (275.3ms) 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 (1.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-18 13:41:53.407281"], ["updated_at", "2017-12-18 13:41:53.407281"]]  (56.4ms) COMMIT ActiveRecord::InternalMetadata Load (1.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.2ms) BEGIN  (1.0ms) COMMIT  (1.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.9ms) BEGIN  (10.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float, "purchase_date" date, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "equipment" ("id") )  (1.2ms) ROLLBACK  (0.9ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.8ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.4ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.5ms) BEGIN  (7.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float, "purchase_date" date, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.2ms) BEGIN  (0.7ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (580.5ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.3ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float, "purchase_date" date, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (10.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (9.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (8.4ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-18 14:08:30.425980"], ["updated_at", "2017-12-18 14:08:30.425980"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.6ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentItems (20171217081426)  (1.3ms) BEGIN  (3.3ms) ALTER TABLE "mks_edm_equipment_items" DROP CONSTRAINT "fk_rails_9c44a32cfe"  (3.0ms) DROP TABLE "mks_edm_equipment_items" SQL (1.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171217081426"]]  (3.3ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.7ms) BEGIN  (1.4ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (2.2ms) DROP TABLE "mks_edm_equipments" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (1.4ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (1.6ms) DROP TABLE "mks_edm_equipment_categories" SQL (1.4ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (2.4ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (1.6ms) BEGIN  (1.9ms) DROP TABLE "mks_edm_equipment_types" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (2.4ms) COMMIT  (0.9ms) SELECT pg_advisory_unlock(5702692353434200530)  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.8ms) BEGIN  (8.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.8ms) BEGIN  (6.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.8ms) BEGIN  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (1.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.9ms) BEGIN  (9.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (3.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (1.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (4.6ms) COMMIT ActiveRecord::InternalMetadata Load (4.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (2.5ms) BEGIN  (1.5ms) COMMIT  (3.5ms) SELECT pg_advisory_unlock(5702692353434200530)  (4.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (539.4ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (6.5ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-18 14:18:32.785024"], ["updated_at", "2017-12-18 14:18:32.785024"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (572.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (6.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-18 14:31:47.308348"], ["updated_at", "2017-12-18 14:31:47.308348"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (574.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (16.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (10.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (6.6ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-18 14:32:33.284199"], ["updated_at", "2017-12-18 14:32:33.284199"]]  (2.0ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (1.4ms) COMMIT  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.2ms) DROP DATABASE IF EXISTS "mks_edm_test"  (577.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-18 14:33:38.933580"], ["updated_at", "2017-12-18 14:33:38.933580"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.7ms) DROP DATABASE IF EXISTS "mks_edm_test"  (591.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.7ms) 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 (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-18 14:36:35.709234"], ["updated_at", "2017-12-18 14:36:35.709234"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.2ms) 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.9ms) SELECT pg_try_advisory_lock(5702692353434200530)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.8ms) BEGIN  (1.4ms) ALTER TABLE "mks_edm_equipment_items" DROP CONSTRAINT "fk_rails_9c44a32cfe"  (1.5ms) DROP TABLE "mks_edm_equipment_items" SQL (1.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171217081426"]]  (4.0ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.7ms) BEGIN  (2.0ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (1.4ms) DROP TABLE "mks_edm_equipments" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (1.1ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (1.3ms) DROP TABLE "mks_edm_equipment_categories" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (1.4ms) DROP TABLE "mks_edm_equipment_types" SQL (1.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (1.9ms) COMMIT  (0.8ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (116.5ms) DROP DATABASE IF EXISTS "mks_edm_test"  (770.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (1.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (12.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.6ms) INSERT INTO "schema_migrations" (version) VALUES (0)  (9.4ms) 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 (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:23:53.120056"], ["updated_at", "2017-12-19 08:23:53.120056"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (0.6ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.8ms) BEGIN  (26.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (3.2ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (1.5ms) BEGIN  (7.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.9ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (7.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.7ms) BEGIN  (7.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (532.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:35:50.641980"], ["updated_at", "2017-12-19 08:35:50.641980"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (561.4ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (9.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:38:40.648750"], ["updated_at", "2017-12-19 08:38:40.648750"]]  (1.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (599.6ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.3ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (8.1ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:40:09.146574"], ["updated_at", "2017-12-19 08:40:09.146574"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.5ms) DROP DATABASE IF EXISTS "mks_edm_test"  (581.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (8.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) [35mCREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:41:11.812308"], ["updated_at", "2017-12-19 08:41:11.812308"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.7ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (109.7ms) DROP DATABASE IF EXISTS "mks_edm_test"  (597.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (5.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:42:16.739994"], ["updated_at", "2017-12-19 08:42:16.739994"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (598.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.2ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.3ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (9.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (9.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:42:43.751055"], ["updated_at", "2017-12-19 08:42:43.751055"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.5ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (625.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (14.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.2ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:43:49.710764"], ["updated_at", "2017-12-19 08:43:49.710764"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (566.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (12.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (6.4ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:44:19.262342"], ["updated_at", "2017-12-19 08:44:19.262342"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (2.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (568.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (11.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.4ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (6.9ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:45:23.070555"], ["updated_at", "2017-12-19 08:45:23.070555"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.6ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.2ms) DROP DATABASE IF EXISTS "mks_edm_test"  (542.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (12.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.9ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:47:21.327549"], ["updated_at", "2017-12-19 08:47:21.327549"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (635.6ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (1.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (20.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (14.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (13.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (4.6ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.9ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (6.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:48:32.553987"], ["updated_at", "2017-12-19 08:48:32.553987"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.3ms) BEGIN  (1.0ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.2ms) DROP DATABASE IF EXISTS "mks_edm_test"  (816.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (8.2ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:48:49.752173"], ["updated_at", "2017-12-19 08:48:49.752173"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (605.9ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (9.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.3ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:49:39.262044"], ["updated_at", "2017-12-19 08:49:39.262044"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (1.1ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (109.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (609.6ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (8.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:49:50.628721"], ["updated_at", "2017-12-19 08:49:50.628721"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.7ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.2ms) DROP DATABASE IF EXISTS "mks_edm_test"  (566.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171217081426)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855);   (7.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-19 08:50:46.124171"], ["updated_at", "2017-12-19 08:50:46.124171"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (1.3ms) 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  (1.1ms) SELECT pg_try_advisory_lock(5702692353434200530)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.7ms) BEGIN  (2.5ms) ALTER TABLE "mks_edm_equipment_items" DROP CONSTRAINT "fk_rails_9c44a32cfe"  (1.9ms) DROP TABLE "mks_edm_equipment_items" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171217081426"]]  (2.7ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (1.5ms) BEGIN  (1.6ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (1.6ms) DROP TABLE "mks_edm_equipments" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (2.6ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.8ms) BEGIN  (1.8ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (2.5ms) DROP TABLE "mks_edm_equipment_categories" SQL (1.5ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (1.3ms) DROP TABLE "mks_edm_equipment_types" SQL (0.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (2.5ms) COMMIT  (1.1ms) SELECT pg_advisory_unlock(5702692353434200530)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.8ms) BEGIN  (10.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (8.6ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (8.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.7ms) BEGIN  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.9ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.8ms) BEGIN  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (2.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.7ms) COMMIT  (1.2ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (7.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (2.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.2ms) BEGIN  (0.7ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (653.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (10.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (4.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (22.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 14:06:19.270700"], ["updated_at", "2017-12-20 14:06:19.270700"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (591.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 14:22:46.144579"], ["updated_at", "2017-12-20 14:22:46.144579"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.4ms) SELECT pg_try_advisory_lock(5702692353434200530)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.5ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (550.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (21.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (51.4ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:22:33.402313"], ["updated_at", "2017-12-20 15:22:33.402313"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (806.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (9.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (12.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:27:13.599715"], ["updated_at", "2017-12-20 15:27:13.599715"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (581.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:31:08.905565"], ["updated_at", "2017-12-20 15:31:08.905565"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.9ms) DROP DATABASE IF EXISTS "mks_edm_test"  (551.6ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.9ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:31:43.431770"], ["updated_at", "2017-12-20 15:31:43.431770"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (566.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:31:59.967628"], ["updated_at", "2017-12-20 15:31:59.967628"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (512.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (12.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.9ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:32:45.739288"], ["updated_at", "2017-12-20 15:32:45.739288"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (219.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (1878.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (77.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (233.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (55.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (20.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (374.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (438.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (465.0ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (431.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (248.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (14.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (15.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (29.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (35.9ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (62.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (32.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (14.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (82.5ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:46:46.764319"], ["updated_at", "2017-12-20 15:46:46.764319"]]  (43.6ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (580.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (84.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (3.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (9.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:48:21.343880"], ["updated_at", "2017-12-20 15:48:21.343880"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.3ms) BEGIN  (0.8ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (638.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (15.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:53:08.777616"], ["updated_at", "2017-12-20 15:53:08.777616"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (561.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:53:26.500862"], ["updated_at", "2017-12-20 15:53:26.500862"]]  (16.8ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (594.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (7.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:53:35.028470"], ["updated_at", "2017-12-20 15:53:35.028470"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (549.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:55:06.347612"], ["updated_at", "2017-12-20 15:55:06.347612"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (538.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:55:17.287158"], ["updated_at", "2017-12-20 15:55:17.287158"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (498.4ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (13.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:55:25.555486"], ["updated_at", "2017-12-20 15:55:25.555486"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (543.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:57:10.191424"], ["updated_at", "2017-12-20 15:57:10.191424"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (517.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.0ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:57:42.539784"], ["updated_at", "2017-12-20 15:57:42.539784"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (517.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:57:56.632454"], ["updated_at", "2017-12-20 15:57:56.632454"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.4ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (1.4ms) BEGIN  (1.2ms) ALTER TABLE "mks_edm_equipment_valuations" DROP CONSTRAINT "fk_rails_b09a0ab3c3"  (1.5ms) DROP TABLE "mks_edm_equipment_valuations" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171220133548"]]  (3.1ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (1.4ms) BEGIN  (2.2ms) ALTER TABLE "mks_edm_equipment_items" DROP CONSTRAINT "fk_rails_9c44a32cfe"  (3.0ms) DROP TABLE "mks_edm_equipment_items" SQL (1.3ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171217081426"]]  (2.5ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (1.2ms) BEGIN  (1.4ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (1.7ms) DROP TABLE "mks_edm_equipments" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (1.2ms) BEGIN  (1.4ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (1.7ms) DROP TABLE "mks_edm_equipment_categories" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (1.3ms) BEGIN  (1.9ms) DROP TABLE "mks_edm_equipment_types" SQL (1.0ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (2.1ms) COMMIT  (0.8ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (12.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (6.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.7ms) BEGIN  (158.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (6.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.8ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN  (0.9ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (607.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (10.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:59:05.517709"], ["updated_at", "2017-12-20 15:59:05.517709"]]  (9.7ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.2ms) DROP DATABASE IF EXISTS "mks_edm_test"  (540.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:59:19.049375"], ["updated_at", "2017-12-20 15:59:19.049375"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (523.9ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (4.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (10.3ms) 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 (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.4ms) BEGIN SQL (2.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 15:59:53.857029"], ["updated_at", "2017-12-20 15:59:53.857029"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.2ms) BEGIN  (0.8ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.7ms) DROP DATABASE IF EXISTS "mks_edm_test"  (570.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.6ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:01:57.646226"], ["updated_at", "2017-12-20 16:01:57.646226"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.5ms) DROP DATABASE IF EXISTS "mks_edm_test"  (538.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:02:04.908931"], ["updated_at", "2017-12-20 16:02:04.908931"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (534.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (12.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (32.6ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:02:11.320715"], ["updated_at", "2017-12-20 16:02:11.320715"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (514.4ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:02:18.515861"], ["updated_at", "2017-12-20 16:02:18.515861"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (586.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:02:24.930460"], ["updated_at", "2017-12-20 16:02:24.930460"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (497.5ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.9ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:02:31.323151"], ["updated_at", "2017-12-20 16:02:31.323151"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.2ms) DROP DATABASE IF EXISTS "mks_edm_test"  (545.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:02:38.536449"], ["updated_at", "2017-12-20 16:02:38.536449"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (549.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:03:26.338333"], ["updated_at", "2017-12-20 16:03:26.338333"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (1.2ms) ALTER TABLE "mks_edm_equipment_valuations" DROP CONSTRAINT "fk_rails_b09a0ab3c3"  (1.3ms) DROP TABLE "mks_edm_equipment_valuations" SQL (0.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171220133548"]]  (3.0ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.5ms) BEGIN  (1.1ms) ALTER TABLE "mks_edm_equipment_items" DROP CONSTRAINT "fk_rails_9c44a32cfe"  (1.2ms) DROP TABLE "mks_edm_equipment_items" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171217081426"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (1.0ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (1.3ms) DROP TABLE "mks_edm_equipments" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (2.4ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (1.0ms) BEGIN  (1.1ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (1.2ms) DROP TABLE "mks_edm_equipment_categories" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (1.7ms) DROP TABLE "mks_edm_equipment_types" SQL (0.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (1.8ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (26.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (2.8ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.9ms) BEGIN  (7.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.9ms) BEGIN  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.6ms) BEGIN  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.5ms) COMMIT  (0.5ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (626.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (11.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (62.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:06:12.050842"], ["updated_at", "2017-12-20 16:06:12.050842"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (1.2ms) 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.5ms) SELECT pg_try_advisory_lock(5702692353434200530)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (1.3ms) ALTER TABLE "mks_edm_equipment_valuations" DROP CONSTRAINT "fk_rails_b09a0ab3c3"  (1.4ms) DROP TABLE "mks_edm_equipment_valuations" SQL (0.9ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171220133548"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.6ms) BEGIN  (1.2ms) ALTER TABLE "mks_edm_equipment_items" DROP CONSTRAINT "fk_rails_9c44a32cfe"  (1.3ms) DROP TABLE "mks_edm_equipment_items" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171217081426"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (1.2ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (1.3ms) DROP TABLE "mks_edm_equipments" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (2.0ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (1.5ms) DROP TABLE "mks_edm_equipment_categories" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (1.9ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (1.3ms) DROP TABLE "mks_edm_equipment_types" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (1.8ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT pg_try_advisory_lock(5702692353434200530)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (7.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (2.8ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (5.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.9ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.7ms) BEGIN  (6.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.6ms) BEGIN  (6.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.7ms) BEGIN  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.7ms) COMMIT  (0.9ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (1152.5ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (60.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (23.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (115.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (128.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (13.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:25:58.046871"], ["updated_at", "2017-12-20 16:25:58.046871"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (322.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (594.5ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (8.6ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (36.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:26:33.120616"], ["updated_at", "2017-12-20 16:26:33.120616"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (112.7ms) DROP DATABASE IF EXISTS "mks_edm_test"  (609.9ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (13.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (19.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (4.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (12.4ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:29:48.767062"], ["updated_at", "2017-12-20 16:29:48.767062"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.9ms) DROP DATABASE IF EXISTS "mks_edm_test"  (528.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:31:48.164223"], ["updated_at", "2017-12-20 16:31:48.164223"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (520.9ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:37:38.090903"], ["updated_at", "2017-12-20 16:37:38.090903"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (684.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:39:01.246569"], ["updated_at", "2017-12-20 16:39:01.246569"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.5ms) DROP DATABASE IF EXISTS "mks_edm_test"  (638.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-20 16:40:36.033795"], ["updated_at", "2017-12-20 16:40:36.033795"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.7ms) DROP DATABASE IF EXISTS "mks_edm_test"  (639.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (7.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (19.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (55.4ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-22 09:16:14.860802"], ["updated_at", "2017-12-22 09:16:14.860802"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.7ms) COMMIT  (0.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (844.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (9.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (7.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-22 13:11:00.047402"], ["updated_at", "2017-12-22 13:11:00.047402"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (163.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (746.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-22 13:14:24.294559"], ["updated_at", "2017-12-22 13:14:24.294559"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (113.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (623.6ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.4ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (9.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (9.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (4.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (7.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-22 13:16:03.696199"], ["updated_at", "2017-12-22 13:16:03.696199"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (113.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (602.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-22 13:16:48.969257"], ["updated_at", "2017-12-22 13:16:48.969257"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (115.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (535.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (36.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (9.6ms) 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 (1.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-22 13:17:49.768574"], ["updated_at", "2017-12-22 13:17:49.768574"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (1.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (2.7ms) BEGIN  (0.8ms) COMMIT  (9.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (17.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (155.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (1459.5ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (34.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (11.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-24 03:24:13.179183"], ["updated_at", "2017-12-24 03:24:13.179183"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.2ms) BEGIN  (0.6ms) COMMIT  (3.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (545.5ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (7.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-24 03:41:02.780781"], ["updated_at", "2017-12-24 03:41:02.780781"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.3ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.5ms) DROP DATABASE IF EXISTS "mks_edm_test"  (473.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (18.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-24 03:43:19.733207"], ["updated_at", "2017-12-24 03:43:19.733207"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (455.9ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-24 03:53:46.990818"], ["updated_at", "2017-12-24 03:53:46.990818"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.2ms) BEGIN  (1.0ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (953.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (605.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (8.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-24 04:00:03.316785"], ["updated_at", "2017-12-24 04:00:03.316785"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.8ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.5ms) DROP DATABASE IF EXISTS "mks_edm_test"  (483.8ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (17.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-24 06:51:38.478223"], ["updated_at", "2017-12-24 06:51:38.478223"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.9ms) COMMIT  (9.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (17.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (282.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (2356.9ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (30.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (4.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (26.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (17.5ms) 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 (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.6ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-26 14:09:45.710853"], ["updated_at", "2017-12-26 14:09:45.710853"]]  (1.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.7ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.7ms) DROP DATABASE IF EXISTS "mks_edm_test"  (746.9ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (12.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (4.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (13.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (9.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (25.2ms) 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 (2.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-26 14:10:57.485337"], ["updated_at", "2017-12-26 14:10:57.485337"]]  (3.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.6ms) COMMIT  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (111.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (614.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (44.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (7.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-26 14:11:36.763048"], ["updated_at", "2017-12-26 14:11:36.763048"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.9ms) DROP DATABASE IF EXISTS "mks_edm_test"  (580.6ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (12.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.0ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.6ms) 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 (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-26 14:12:27.269569"], ["updated_at", "2017-12-26 14:12:27.269569"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.5ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (1.0ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (730.5ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (21.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (71.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (21.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (379.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (58.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (44.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (199.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (4.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2017-12-26 14:12:43.528992"], ["updated_at", "2017-12-26 14:12:43.528992"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.6ms) SELECT pg_try_advisory_lock(5702692353434200530)  (2.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (0.8ms) COMMIT  (0.8ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (512.7ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.4ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (1.1ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (5.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (6.7ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (8.8ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (1.5ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (11.1ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (22.7ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (7.3ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (27.2ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (5.0ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (7.5ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (5.2ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (5.2ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (5.8ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (8.5ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (9.4ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.5ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (9.5ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (4.0ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (8.9ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (4.0ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (3.5ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (4.1ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (50.4ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.0ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (7.5ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (4.6ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (4.6ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (8.2ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.8ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.4ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.9ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (5.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (4.1ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.9ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (3.5ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (3.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (4.1ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (3.5ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (3.7ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (4.7ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (3.0ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (7.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.9ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:08:27.467075"], ["updated_at", "2018-01-23 15:08:27.467075"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.7ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (487.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (7.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (41.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (7.5ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (6.9ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (6.5ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (7.0ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (3.4ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (3.3ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (3.3ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (3.5ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.3ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (3.7ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.3ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (6.9ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (3.3ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (12.7ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (16.0ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (14.8ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (7.8ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (13.8ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (5.3ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.3ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.3ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (3.0ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (3.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:09:05.742838"], ["updated_at", "2018-01-23 15:09:05.742838"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.7ms) DROP DATABASE IF EXISTS "mks_edm_test"  (486.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (29.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (20.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (7.4ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (3.3ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (3.4ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (3.3ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (3.5ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.4ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (3.6ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.5ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (6.7ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (10.1ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (3.4ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (7.4ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (3.7ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (3.4ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (3.4ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (7.3ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (7.0ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (4.5ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.7ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.5ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (48.6ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (7.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (179.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (261.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (3.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (3.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:09:57.579835"], ["updated_at", "2018-01-23 15:09:57.579835"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.6ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (529.3ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.8ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (10.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (31.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (36.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (6.5ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (7.4ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (7.4ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (3.4ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (3.4ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (4.1ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (4.1ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.4ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (3.5ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.5ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (51.4ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (9.3ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (3.6ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (7.6ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (3.6ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (3.6ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (3.5ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (7.3ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (4.5ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.9ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.4ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (14.6ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (10.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (10.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (5.9ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (5.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (7.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.7ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (3.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (6.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (5.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (7.0ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (11.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (3.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (8.5ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.8ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.7ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:11:12.112269"], ["updated_at", "2018-01-23 15:11:12.112269"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.1ms) DROP DATABASE IF EXISTS "mks_edm_test"  (500.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (22.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (16.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (6.9ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (7.6ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (3.5ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (3.4ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (3.5ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (3.7ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.6ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (3.7ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.7ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (7.6ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (33.4ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (10.8ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (4.6ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (9.2ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (4.0ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (3.5ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (4.0ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (7.5ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (4.5ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.8ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.5ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (7.8ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (3.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (3.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:12:03.572607"], ["updated_at", "2018-01-23 15:12:03.572607"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (485.0ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.0ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (49.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (7.4ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (6.5ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (7.6ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (3.4ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (3.4ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (3.5ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (3.3ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (4.0ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (3.7ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.4ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (6.9ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (7.0ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (51.6ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (3.4ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (3.8ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (3.5ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (3.3ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (6.7ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (4.5ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.5ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.4ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (7.3ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.9ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (3.0ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:12:56.942858"], ["updated_at", "2018-01-23 15:12:56.942858"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (117.0ms) DROP DATABASE IF EXISTS "mks_edm_test"  (541.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (8.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.8ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (5.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (9.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (12.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (54.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.4ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (8.3ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (8.7ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (12.0ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (12.9ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (4.3ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (4.6ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (4.7ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (4.7ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.9ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (6.5ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (24.6ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (1.7ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (90.0ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.5ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (21.5ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (17.2ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (13.1ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (13.4ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (1.2ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (27.5ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (6.2ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (4.6ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (5.4ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (1.0ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (13.2ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (36.1ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.7ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (11.9ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (27.8ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (69.2ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (183.9ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (1.2ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (61.6ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (24.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (9.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (10.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (11.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (9.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (14.8ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (5.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (8.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (4.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (11.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (7.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (15.0ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (9.0ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (21.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (9.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (7.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (21.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (26.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (12.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (6.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (13.0ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (15.8ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (44.0ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (16.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (17.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (4.5ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (6.9ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (9.5ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (4.3ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (72.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (3.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (4.3ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (8.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:13:37.213564"], ["updated_at", "2018-01-23 15:13:37.213564"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.8ms) COMMIT  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (116.4ms) DROP DATABASE IF EXISTS "mks_edm_test"  (508.6ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (8.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (25.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.3ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (17.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (9.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (9.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (10.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (9.5ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (10.5ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (10.0ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (10.4ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (4.8ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (13.2ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (5.5ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (5.0ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (5.1ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (5.3ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (5.0ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (1.1ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (10.6ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (10.6ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (9.6ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (5.5ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (1.0ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (9.9ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.0ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (5.3ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (5.5ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (8.0ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (1.3ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (13.4ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (14.2ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.8ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (1.3ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (7.8ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (7.1ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (6.4ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (5.5ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (1.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (15.2ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (4.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (4.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (4.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (4.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (4.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (4.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (4.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (6.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (4.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (5.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (4.0ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (5.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (4.5ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (4.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (7.0ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (3.9ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (3.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (4.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (3.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (4.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (3.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (3.8ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.7ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (4.9ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (3.7ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.1ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (4.9ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (15.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (3.1ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (9.0ms) 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 (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (2.1ms) BEGIN SQL (2.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:14:01.521858"], ["updated_at", "2018-01-23 15:14:01.521858"]]  (2.5ms) COMMIT ActiveRecord::InternalMetadata Load (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN  (1.2ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.8ms) DROP DATABASE IF EXISTS "mks_edm_test"  (536.2ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (7.0ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (8.4ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (28.6ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (1.2ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (26.7ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.3ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (20.9ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (14.1ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (5.1ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (3.5ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (3.6ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.3ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (11.5ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.9ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (8.0ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (18.0ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (11.2ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (3.5ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (3.4ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (3.4ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (22.8ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (1.3ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (48.1ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.3ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (79.6ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (4.7ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.4ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.3ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (7.7ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.1ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:15:01.215757"], ["updated_at", "2018-01-23 15:15:01.215757"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.6ms) DROP DATABASE IF EXISTS "mks_edm_test"  (493.1ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (5.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (57.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.9ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (7.5ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (7.3ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (3.5ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (3.6ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (3.6ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (3.5ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.5ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (3.6ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.5ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (7.3ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (48.3ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (3.7ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (8.4ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (4.2ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (3.4ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (3.6ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (4.6ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.4ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.4ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (7.4ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (3.2ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-23 15:15:11.336498"], ["updated_at", "2018-01-23 15:15:11.336498"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (8.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (83.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (158.3ms) DROP DATABASE IF EXISTS "mks_edm_test"  (1348.4ms) CREATE DATABASE "mks_edm_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (28.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "application_module_id" integer, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_users_on_application_module_id" ON "mks_auth_users" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (15.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (20.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (15.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_maintenance_cost_types" CASCADE  (6.7ms) CREATE TABLE "mks_maintenance_cost_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "fields" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_locations" CASCADE  (7.5ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_equipment_statuses" CASCADE  (6.8ms) CREATE TABLE "mks_maintenance_equipment_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_job_cards" CASCADE  (6.9ms) CREATE TABLE "mks_maintenance_job_cards" ("id" bigserial primary key, "maintenance_service_order_id" bigint, "code" character varying, "start_date" date, "due_date" date, "service_provider_id" bigint, "checkout_date" date, "checkout_by_id" bigint, "checkout_to_id" bigint, "maintenance_status_id" bigint, "checkin_date" date, "checkin_by_id" bigint, "checkin_to_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, "approved" boolean DEFAULT 'f', "checkout_confirmed" boolean DEFAULT 'f', "checkin_confirmed" boolean DEFAULT 'f', "costs_approved" boolean DEFAULT 'f', "prepared_by_id" integer)  (4.5ms) CREATE INDEX "chb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_by_id")  (3.5ms) CREATE INDEX "cht_on_jc_indx" ON "mks_maintenance_job_cards" ("checkin_to_id")  (3.9ms) CREATE INDEX "cb_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_by_id")  (3.4ms) CREATE INDEX "ct_on_jc_indx" ON "mks_maintenance_job_cards" ("checkout_to_id")  (3.4ms) CREATE INDEX "mso_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_service_order_id")  (3.7ms) CREATE INDEX "ms_on_jc_indx" ON "mks_maintenance_job_cards" ("maintenance_status_id")  (3.6ms) CREATE INDEX "sp_on_jc_indx" ON "mks_maintenance_job_cards" ("service_provider_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_location_types" CASCADE  (7.5ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_categories" CASCADE  (22.3ms) CREATE TABLE "mks_maintenance_maintenance_categories" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_costs" CASCADE  (10.7ms) CREATE TABLE "mks_maintenance_maintenance_costs" ("id" bigserial primary key, "job_card_id" bigint, "cost_type_id" bigint, "cost_detail" json NOT NULL, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ct_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("cost_type_id")  (3.6ms) CREATE INDEX "jc_on_mc_indx" ON "mks_maintenance_maintenance_costs" ("job_card_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_service_orders" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_maintenance_service_orders" ("id" bigserial primary key, "title" character varying NOT NULL, "description" character varying, "equipment_item_id" bigint, "maintenance_type_id" bigint, "start_date" date, "end_date" date, "prepared_by_id" bigint, "approved" boolean DEFAULT 'f', "approved_by_id" bigint, "remark" character varying, "current_reading" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (26.0ms) CREATE INDEX "ab_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("approved_by_id")  (12.8ms) CREATE INDEX "ei_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("equipment_item_id")  (4.7ms) CREATE INDEX "mt_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("maintenance_type_id")  (4.2ms) CREATE INDEX "pb_on_mso_indx" ON "mks_maintenance_maintenance_service_orders" ("prepared_by_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_statuses" CASCADE  (6.9ms) CREATE TABLE "mks_maintenance_maintenance_statuses" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_maintenance_types" CASCADE  (7.2ms) CREATE TABLE "mks_maintenance_maintenance_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "maintenance_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "mt_on_mc_indx" ON "mks_maintenance_maintenance_types" ("maintenance_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_settings" CASCADE  (4.6ms) CREATE TABLE "mks_maintenance_schedule_settings" ("id" bigserial primary key, "equipment_id" bigint, "maintenance_type_id" bigint, "schedule_unit_id" bigint, "value" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ss_indx" ON "mks_maintenance_schedule_settings" ("equipment_id")  (3.3ms) CREATE INDEX "mt_on_ss_indx" ON "mks_maintenance_schedule_settings" ("maintenance_type_id")  (3.3ms) CREATE INDEX "su_on_ss_indx" ON "mks_maintenance_schedule_settings" ("schedule_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_maintenance_schedule_units" CASCADE  (7.1ms) CREATE TABLE "mks_maintenance_schedule_units" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users" ADD CONSTRAINT "fk_rails_f959d07fb8" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (2.8ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_71608df4d7" FOREIGN KEY ("checkin_by_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_2d751894b3" FOREIGN KEY ("checkout_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_b1bfab76fa" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_4b617666f2" FOREIGN KEY ("checkin_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_da85f112f1" FOREIGN KEY ("checkout_to_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (2.2ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_432c5d16fa" FOREIGN KEY ("service_provider_id") REFERENCES "mks_maintenance_equipment_locations" ("id")   (3.1ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_d5dda430d5" FOREIGN KEY ("maintenance_service_order_id") REFERENCES "mks_maintenance_maintenance_service_orders" ("id")   (2.6ms) ALTER TABLE "mks_maintenance_job_cards" ADD CONSTRAINT "fk_rails_14cf824cbc" FOREIGN KEY ("maintenance_status_id") REFERENCES "mks_maintenance_maintenance_statuses" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e7f1fb2bae" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_e104595312" FOREIGN KEY ("prepared_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_3f3405378e" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_service_orders" ADD CONSTRAINT "fk_rails_744b2022f5" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.4ms) ALTER TABLE "mks_maintenance_maintenance_types" ADD CONSTRAINT "fk_rails_40e7db53d5" FOREIGN KEY ("maintenance_category_id") REFERENCES "mks_maintenance_maintenance_categories" ("id")   (2.9ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_6b4df17776" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_eed98d8173" FOREIGN KEY ("maintenance_type_id") REFERENCES "mks_maintenance_maintenance_types" ("id")   (2.3ms) ALTER TABLE "mks_maintenance_schedule_settings" ADD CONSTRAINT "fk_rails_07f79b50c2" FOREIGN KEY ("schedule_unit_id") REFERENCES "mks_maintenance_schedule_units" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180121074724)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (11.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-01-26 07:50:18.436487"], ["updated_at", "2018-01-26 07:50:18.436487"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.7ms) COMMIT  (0.7ms) SELECT pg_try_advisory_lock(5702692353434200530)  (10.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ActiveRecord::InternalMetadata Load (79.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.5ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(5702692353434200530)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (9.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (5.9ms) 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)  (0.9ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.9ms) BEGIN  (5.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (1.1ms) BEGIN  (6.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.9ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.9ms) BEGIN  (6.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.9ms) BEGIN  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (2.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN SQL (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-04 15:40:41.116766"], ["updated_at", "2018-02-04 15:40:41.116766"]]  (1.8ms) COMMIT  (1.2ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (118.2ms) DROP DATABASE IF EXISTS "construction_test"  (334.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (5.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-04 15:40:46.996796"], ["updated_at", "2018-02-04 15:40:46.996796"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.7ms) DROP DATABASE IF EXISTS "construction_test"  (316.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (2.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (24.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (7.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN SQL (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-04 15:41:55.634707"], ["updated_at", "2018-02-04 15:41:55.634707"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.6ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.2ms) DROP DATABASE IF EXISTS "construction_test"  (336.2ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-04 15:44:03.064873"], ["updated_at", "2018-02-04 15:44:03.064873"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.8ms) COMMIT  (0.5ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (14.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.9ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.7ms) BEGIN  (6.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.8ms) BEGIN  (7.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.7ms) BEGIN  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.9ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.8ms) BEGIN  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.8ms) COMMIT  (0.8ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (110.5ms) DROP DATABASE IF EXISTS "construction_test"  (330.6ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.4ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.7ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (1.0ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-04 15:47:39.875291"], ["updated_at", "2018-02-04 15:47:39.875291"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN  (0.7ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.3ms) DROP DATABASE IF EXISTS "construction_test"  (335.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.7ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-04 15:49:41.158059"], ["updated_at", "2018-02-04 15:49:41.158059"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (1.3ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.8ms) DROP DATABASE IF EXISTS "construction_test"  (322.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (8.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (8.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.1ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.3ms) 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 (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-04 15:51:19.181513"], ["updated_at", "2018-02-04 15:51:19.181513"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.4ms) COMMIT  (0.6ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmLocationTypes (20171215080758)  (0.8ms) BEGIN  (14.8ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215080758"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.6ms) BEGIN  (5.7ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (2.4ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215081601"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (5.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.4ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.7ms) BEGIN  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.8ms) BEGIN  (5.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.4ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.6ms) BEGIN  (6.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (1.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (4.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (0.6ms) ROLLBACK  (0.7ms) SELECT pg_advisory_unlock(8683284875916872550)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(8683284875916872550)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (1.3ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (1.7ms) DROP TABLE "mks_edm_equipments" SQL (1.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.5ms) BEGIN  (1.1ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (1.3ms) DROP TABLE "mks_edm_equipment_categories" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (1.2ms) DROP TABLE "mks_edm_equipment_types" SQL (0.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.5ms) BEGIN  (1.7ms) ALTER TABLE "mks_maintenance_equipment_locations" DROP CONSTRAINT "fk_rails_00c2e40f40"  (1.6ms) DROP TABLE "mks_maintenance_equipment_locations" SQL (1.7ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171215081601"]]  (2.2ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(8683284875916872550)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT pg_try_advisory_lock(8683284875916872550)  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.5ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmLocationTypes (20171215080758)  (1.1ms) BEGIN  (14.0ms) CREATE TABLE "mks_maintenance_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215080758"]]  (2.5ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.7ms) BEGIN  (7.8ms) CREATE TABLE "mks_maintenance_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_maintenance_equipment_locations" ("location_type_id")  (1.9ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215081601"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (5.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.7ms) BEGIN  (5.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (1.0ms) BEGIN  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.8ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.8ms) BEGIN  (5.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (3.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (5.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.0ms) ROLLBACK  (0.7ms) SELECT pg_advisory_unlock(8683284875916872550)  (1.1ms) 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.6ms) SELECT pg_try_advisory_lock(8683284875916872550)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (1.5ms) ALTER TABLE "mks_edm_equipments" DROP CONSTRAINT "fk_rails_59110db010"  (2.0ms) DROP TABLE "mks_edm_equipments" SQL (1.1ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216070855"]]  (10.1ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (1.1ms) ALTER TABLE "mks_edm_equipment_categories" DROP CONSTRAINT "fk_rails_37d48f9db9"  (1.3ms) DROP TABLE "mks_edm_equipment_categories" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216041414"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.8ms) BEGIN  (2.1ms) DROP TABLE "mks_edm_equipment_types" SQL (1.3ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171216024320"]]  (1.9ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.6ms) BEGIN  (1.1ms) ALTER TABLE "mks_maintenance_equipment_locations" DROP CONSTRAINT "fk_rails_00c2e40f40"  (1.3ms) DROP TABLE "mks_maintenance_equipment_locations" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171215081601"]]  (1.9ms) COMMIT Migrating to CreateMksEdmLocationTypes (20171215080758)  (1.0ms) BEGIN  (1.5ms) DROP TABLE "mks_maintenance_location_types" SQL (0.8ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20171215080758"]]  (1.8ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmLocationTypes (20171215080758)  (0.7ms) BEGIN  (14.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215080758"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.6ms) BEGIN  (6.1ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (10.9ms) ALTER TABLE "mks_maintenance_equipment_locations" ADD CONSTRAINT "fk_rails_00c2e40f40" FOREIGN KEY ("location_type_id") REFERENCES "mks_maintenance_location_types" ("id")   (0.6ms) ROLLBACK  (0.6ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.5ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.9ms) BEGIN  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (1.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215081601"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.6ms) BEGIN  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.3ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.7ms) BEGIN  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (5.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.7ms) BEGIN  (7.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (1.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (7.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.5ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.7ms) DROP DATABASE IF EXISTS "construction_test"  (321.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.4ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:43:31.266487"], ["updated_at", "2018-02-05 15:43:31.266487"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.7ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.5ms) DROP DATABASE IF EXISTS "construction_test"  (329.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:45:03.364050"], ["updated_at", "2018-02-05 15:45:03.364050"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.7ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.8ms) DROP DATABASE IF EXISTS "construction_test"  (339.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (8.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (5.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (5.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:46:51.048998"], ["updated_at", "2018-02-05 15:46:51.048998"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (125.9ms) DROP DATABASE IF EXISTS "construction_test"  (334.2ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.9ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.0ms) 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 (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:48:28.138003"], ["updated_at", "2018-02-05 15:48:28.138003"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.7ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.5ms) DROP DATABASE IF EXISTS "construction_test"  (341.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.7ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:49:53.644761"], ["updated_at", "2018-02-05 15:49:53.644761"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.7ms) DROP DATABASE IF EXISTS "construction_test"  (306.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:50:09.264130"], ["updated_at", "2018-02-05 15:50:09.264130"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.8ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.4ms) DROP DATABASE IF EXISTS "construction_test"  (346.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (5.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.7ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:50:58.260665"], ["updated_at", "2018-02-05 15:50:58.260665"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.6ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.1ms) DROP DATABASE IF EXISTS "construction_test"  (322.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.9ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:55:22.171109"], ["updated_at", "2018-02-05 15:55:22.171109"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (126.5ms) DROP DATABASE IF EXISTS "construction_test"  (315.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.4ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.3ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:55:47.119793"], ["updated_at", "2018-02-05 15:55:47.119793"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.9ms) DROP DATABASE IF EXISTS "construction_test"  (332.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.3ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-05 15:56:25.887974"], ["updated_at", "2018-02-05 15:56:25.887974"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (124.2ms) DROP DATABASE IF EXISTS "construction_test"  (324.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-06 15:16:45.380588"], ["updated_at", "2018-02-06 15:16:45.380588"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.5ms) DROP DATABASE IF EXISTS "construction_test"  (330.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (10.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (5.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (12.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (2.3ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (5.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (4.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (12.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (5.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.7ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-06 15:18:10.822581"], ["updated_at", "2018-02-06 15:18:10.822581"]]  (1.7ms) COMMIT ActiveRecord::InternalMetadata Load (1.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.5ms) COMMIT  (3.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (119.3ms) DROP DATABASE IF EXISTS "construction_test"  (451.6ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.6ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (9.6ms) 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 (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-07 16:08:47.716677"], ["updated_at", "2018-02-07 16:08:47.716677"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.7ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.2ms) DROP DATABASE IF EXISTS "construction_test"  (337.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (2.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (2.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (5.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (2.9ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (5.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.1ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-07 16:11:56.520659"], ["updated_at", "2018-02-07 16:11:56.520659"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.6ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.0ms) DROP DATABASE IF EXISTS "construction_test"  (332.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.5ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-07 16:12:20.608165"], ["updated_at", "2018-02-07 16:12:20.608165"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.0ms) DROP DATABASE IF EXISTS "construction_test"  (322.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (5.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-07 16:12:56.176929"], ["updated_at", "2018-02-07 16:12:56.176929"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.6ms) DROP DATABASE IF EXISTS "construction_test"  (322.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-07 16:13:42.580990"], ["updated_at", "2018-02-07 16:13:42.580990"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (125.5ms) DROP DATABASE IF EXISTS "construction_test"  (329.2ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.1ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (1.2ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (1.2ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (5.1ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (1.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (10.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (11.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.7ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.4ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-07 16:16:00.918612"], ["updated_at", "2018-02-07 16:16:00.918612"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (124.2ms) DROP DATABASE IF EXISTS "construction_test"  (321.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.5ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (8.4ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-07 16:20:38.136554"], ["updated_at", "2018-02-07 16:20:38.136554"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (5.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (174.5ms) DROP DATABASE IF EXISTS "construction_test"  (374.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (20.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (8.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (10.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.2ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (6.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (12.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (7.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (9.1ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (9.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:03:06.824907"], ["updated_at", "2018-02-08 02:03:06.824907"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.7ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (4.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (131.7ms) DROP DATABASE IF EXISTS "construction_test"  (335.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (10.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (5.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.4ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (8.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (1.1ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (3.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (8.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (13.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (12.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (9.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (9.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (10.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (12.5ms) 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 (2.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:10:27.426915"], ["updated_at", "2018-02-08 02:10:27.426915"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.8ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (124.0ms) DROP DATABASE IF EXISTS "construction_test"  (368.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (9.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.1ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:11:37.445588"], ["updated_at", "2018-02-08 02:11:37.445588"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (119.5ms) DROP DATABASE IF EXISTS "construction_test"  (325.2ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (5.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (9.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (10.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:18:37.577462"], ["updated_at", "2018-02-08 02:18:37.577462"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.7ms) DROP DATABASE IF EXISTS "construction_test"  (332.2ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (5.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.4ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:19:11.440166"], ["updated_at", "2018-02-08 02:19:11.440166"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (119.3ms) DROP DATABASE IF EXISTS "construction_test"  (341.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (5.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (9.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.1ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:19:34.096262"], ["updated_at", "2018-02-08 02:19:34.096262"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.0ms) DROP DATABASE IF EXISTS "construction_test"  (331.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.2ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (5.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (9.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:19:55.429524"], ["updated_at", "2018-02-08 02:19:55.429524"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (119.2ms) DROP DATABASE IF EXISTS "construction_test"  (340.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (10.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (10.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (11.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (8.4ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:22:38.369033"], ["updated_at", "2018-02-08 02:22:38.369033"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.8ms) DROP DATABASE IF EXISTS "construction_test"  (338.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.2ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (5.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.6ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (11.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (10.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (9.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (8.3ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 02:24:30.226498"], ["updated_at", "2018-02-08 02:24:30.226498"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.5ms) COMMIT  (4.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (3.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.3ms) DROP DATABASE IF EXISTS "construction_test"  (448.6ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.2ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.1ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.9ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.2ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.3ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 12:20:15.739088"], ["updated_at", "2018-02-08 12:20:15.739088"]]  (2.1ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (1.0ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.1ms) DROP DATABASE IF EXISTS "construction_test"  (329.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.3ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 12:21:58.955466"], ["updated_at", "2018-02-08 12:21:58.955466"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.3ms) DROP DATABASE IF EXISTS "construction_test"  (337.2ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 12:22:48.264244"], ["updated_at", "2018-02-08 12:22:48.264244"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.0ms) DROP DATABASE IF EXISTS "construction_test"  (316.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (4.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.7ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-08 12:23:40.756880"], ["updated_at", "2018-02-08 12:23:40.756880"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.6ms) COMMIT  (4.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.3ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (334.5ms) DROP DATABASE IF EXISTS "construction_test"  (396.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (23.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (10.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (8.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (5.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (3.0ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (15.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (10.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.5ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (5.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (4.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.3ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-10 05:37:18.561134"], ["updated_at", "2018-02-10 05:37:18.561134"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (1.4ms) DROP DATABASE IF EXISTS "construction_development"  (0.8ms) DROP DATABASE IF EXISTS "construction_test"  (8.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (6.1ms) 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)  (0.6ms) SELECT pg_try_advisory_lock(8683284875916872550)  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmLocationTypes (20171215080758)  (0.7ms) BEGIN  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215080758"]]  (1.4ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.7ms) BEGIN  (6.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.8ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215081601"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (6.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.3ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (6.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.4ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.6ms) BEGIN  (6.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (1.4ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.7ms) BEGIN  (5.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.8ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (1.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (1.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.8ms) BEGIN  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (2.0ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.3ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 03:20:31.271987"], ["updated_at", "2018-02-28 03:20:31.271987"]]  (1.4ms) COMMIT  (0.7ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.7ms) 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  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (119.9ms) DROP DATABASE IF EXISTS "construction_test"  (330.1ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.1ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 03:20:39.111984"], ["updated_at", "2018-02-28 03:20:39.111984"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (119.2ms) DROP DATABASE IF EXISTS "construction_test"  (323.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20171220133548)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426);   (6.0ms) 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 (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 03:21:54.016406"], ["updated_at", "2018-02-28 03:21:54.016406"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (0.7ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.7ms) COMMIT  (0.7ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (160.0ms) DROP DATABASE IF EXISTS "construction_test"  (365.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.3ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (5.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (1.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (3.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 07:15:37.023988"], ["updated_at", "2018-02-28 07:15:37.023988"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.4ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.0ms) DROP DATABASE IF EXISTS "construction_test"  (316.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 07:30:25.233777"], ["updated_at", "2018-02-28 07:30:25.233777"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.7ms) DROP DATABASE IF EXISTS "construction_test"  (331.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 07:50:19.463270"], ["updated_at", "2018-02-28 07:50:19.463270"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN  (0.5ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.5ms) DROP DATABASE IF EXISTS "construction_test"  (334.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.3ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.7ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 07:56:35.635677"], ["updated_at", "2018-02-28 07:56:35.635677"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.2ms) DROP DATABASE IF EXISTS "construction_test"  (325.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.0ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (7.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 07:57:25.921170"], ["updated_at", "2018-02-28 07:57:25.921170"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.7ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.7ms) DROP DATABASE IF EXISTS "construction_test"  (349.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (3.4ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.7ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 07:57:45.415155"], ["updated_at", "2018-02-28 07:57:45.415155"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.6ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.3ms) DROP DATABASE IF EXISTS "construction_test"  (327.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (8.0ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 08:00:22.970209"], ["updated_at", "2018-02-28 08:00:22.970209"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.8ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (126.4ms) DROP DATABASE IF EXISTS "construction_test"  (324.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.0ms) 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 (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 08:03:56.467575"], ["updated_at", "2018-02-28 08:03:56.467575"]]  (1.7ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.2ms) DROP DATABASE IF EXISTS "construction_test"  (326.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (1.2ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.0ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (3.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 14:04:14.108440"], ["updated_at", "2018-02-28 14:04:14.108440"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.9ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (119.4ms) DROP DATABASE IF EXISTS "construction_test"  (327.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (3.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (7.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (4.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.5ms) 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 (2.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 14:04:32.916697"], ["updated_at", "2018-02-28 14:04:32.916697"]]  (1.7ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.9ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.5ms) DROP DATABASE IF EXISTS "construction_test"  (326.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (12.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (5.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (4.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (11.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (8.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180201104912)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.3ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-28 14:04:45.491828"], ["updated_at", "2018-02-28 14:04:45.491828"]]  (2.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN  (0.5ms) COMMIT  (0.5ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmLocationTypes (20171215080758)  (0.7ms) BEGIN  (14.8ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215080758"]]  (2.1ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.6ms) BEGIN  (6.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (3.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215081601"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.7ms) BEGIN  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.7ms) BEGIN  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (2.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (2.0ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.8ms) BEGIN  (6.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.9ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.6ms) BEGIN  (6.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.8ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (1.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.7ms) BEGIN  (6.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (0.7ms) COMMIT  (0.7ms) SELECT pg_advisory_unlock(8683284875916872550)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmLocationTypes (20171215080758)  (0.7ms) BEGIN  (21.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215080758"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.6ms) BEGIN  (11.9ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (2.2ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")  SQL (1.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215081601"]]  (3.5ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.8ms) BEGIN  (11.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.9ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (15.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (3.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (0.8ms) BEGIN  (15.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (7.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.6ms) BEGIN  (20.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (5.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (1.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (1.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.7ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (13.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (2.1ms) COMMIT ActiveRecord::InternalMetadata Load (1.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN  (0.6ms) COMMIT  (0.6ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT pg_try_advisory_lock(8683284875916872550)  (3.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmEquipmentComponents (20180317043420)  (0.6ms) BEGIN  (50.0ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (11.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (15.0ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180317043420"]]  (2.4ms) COMMIT ActiveRecord::InternalMetadata Load (2.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN  (0.6ms) COMMIT  (0.8ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (142.7ms) DROP DATABASE IF EXISTS "construction_test"  (525.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (2.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (6.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.3ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.3ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.1ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.7ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.1ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.2ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.2ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.5ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.2ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.3ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.0ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.9ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.1ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-17 04:39:33.553597"], ["updated_at", "2018-03-17 04:39:33.553597"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-17 04:39:33.561407"], ["key", "environment"]]  (1.2ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (115.7ms) DROP DATABASE IF EXISTS "construction_test"  (330.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.3ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.3ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.2ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.3ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.1ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.5ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.2ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.6ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.2ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.3ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.8ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.4ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.3ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.2ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.0ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-17 04:40:02.338223"], ["updated_at", "2018-03-17 04:40:02.338223"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-17 04:40:02.345766"], ["key", "environment"]]  (1.3ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (124.1ms) DROP DATABASE IF EXISTS "construction_test"  (334.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (3.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (5.9ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.1ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (8.7ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.4ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.1ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.1ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.1ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.7ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.1ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.3ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.6ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.1ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.3ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.0ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-17 05:07:32.358603"], ["updated_at", "2018-03-17 05:07:32.358603"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-17 05:07:32.366035"], ["key", "environment"]]  (1.2ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.5ms) DROP DATABASE IF EXISTS "construction_test"  (329.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.5ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.2ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.2ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.2ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.4ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.1ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.6ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.3ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.1ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.3ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.1ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.2ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.0ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.1ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.1ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-17 05:08:46.569706"], ["updated_at", "2018-03-17 05:08:46.569706"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-17 05:08:46.577065"], ["key", "environment"]]  (1.3ms) COMMIT  (4.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (151.7ms) DROP DATABASE IF EXISTS "construction_test"  (402.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (2.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (28.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.4ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.2ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (8.7ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (10.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.2ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.4ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.2ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.3ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.3ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.8ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.3ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.0ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.8ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (4.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.1ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (3.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.0ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (3.1ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.3ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN SQL (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 13:44:33.659107"], ["updated_at", "2018-03-21 13:44:33.659107"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 13:44:33.667112"], ["key", "environment"]]  (1.4ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.8ms) DROP DATABASE IF EXISTS "construction_test"  (335.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.9ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.4ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.1ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.4ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.8ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.2ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.9ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.9ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.3ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.6ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 13:45:02.798618"], ["updated_at", "2018-03-21 13:45:02.798618"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 13:45:02.807109"], ["key", "environment"]]  (1.3ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.5ms) DROP DATABASE IF EXISTS "construction_test"  (332.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.7ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.1ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.7ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.2ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.6ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.7ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.6ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.8ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.7ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.6ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.2ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.8ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 13:45:59.553882"], ["updated_at", "2018-03-21 13:45:59.553882"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 13:45:59.562593"], ["key", "environment"]]  (1.3ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.1ms) DROP DATABASE IF EXISTS "construction_test"  (368.1ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.3ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.3ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.5ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.4ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.1ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.1ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.7ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.1ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.4ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.2ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.6ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.2ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 13:47:12.661700"], ["updated_at", "2018-03-21 13:47:12.661700"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 13:47:12.670533"], ["key", "environment"]]  (1.3ms) COMMIT  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.5ms) DROP DATABASE IF EXISTS "construction_test"  (333.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.3ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.5ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.4ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.9ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.2ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.1ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.5ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.7ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.6ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.8ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.2ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.7ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.3ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.4ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (4.0ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.9ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.9ms) 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.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 13:47:44.354044"], ["updated_at", "2018-03-21 13:47:44.354044"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.2ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 13:47:44.361636"], ["key", "environment"]]  (1.5ms) COMMIT  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (127.2ms) DROP DATABASE IF EXISTS "construction_test"  (324.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.2ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.7ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.3ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.0ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.4ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.2ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.3ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.0ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.5ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.2ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.3ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (3.8ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 13:48:41.891030"], ["updated_at", "2018-03-21 13:48:41.891030"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.0ms) BEGIN SQL (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 13:48:41.899821"], ["key", "environment"]]  (1.3ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.3ms) DROP DATABASE IF EXISTS "construction_test"  (321.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (5.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.5ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.7ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.5ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.9ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.6ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.4ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.7ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.7ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.3ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.9ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.8ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.2ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.3ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.7ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.0ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN SQL (1.6ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 14:10:42.499621"], ["updated_at", "2018-03-21 14:10:42.499621"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 14:10:42.508407"], ["key", "environment"]]  (1.5ms) COMMIT  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (125.6ms) DROP DATABASE IF EXISTS "construction_test"  (318.6ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.2ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (8.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (5.1ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.4ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.6ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.3ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.1ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (4.1ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.7ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.6ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.9ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.4ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.4ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.8ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.3ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.9ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.1ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (5.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 15:44:55.068119"], ["updated_at", "2018-03-21 15:44:55.068119"]]  (1.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN SQL (0.7ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 15:44:55.075413"], ["key", "environment"]]  (1.2ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (124.4ms) DROP DATABASE IF EXISTS "construction_test"  (326.6ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.2ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (5.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.3ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.2ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.3ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.1ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.2ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.4ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.1ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.2ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.5ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.4ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.2ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (5.8ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.7ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.5ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.9ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.8ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (3.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (4.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.3ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.1ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-03-21 16:18:18.737835"], ["updated_at", "2018-03-21 16:18:18.737835"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (1.1ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-03-21 16:18:18.745677"], ["key", "environment"]]  (1.3ms) COMMIT  (0.9ms) SELECT pg_try_advisory_lock(8683284875916872550)  (1.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateMksEdmLocationTypes (20171215080758)  (1.0ms) BEGIN  (16.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215080758"]]  (1.5ms) COMMIT Migrating to CreateMksEdmEquipmentLocations (20171215081601)  (0.6ms) BEGIN  (5.9ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (2.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")  SQL (1.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171215081601"]]  (1.8ms) COMMIT Migrating to CreateMksEdmEquipmentTypes (20171216024320)  (0.8ms) BEGIN  (6.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216024320"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentCategories (20171216041414)  (0.6ms) BEGIN  (8.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")  SQL (1.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216041414"]]  (1.9ms) COMMIT Migrating to CreateMksEdmEquipments (20171216070855)  (1.1ms) BEGIN  (9.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (2.0ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171216070855"]]  (1.6ms) COMMIT Migrating to CreateMksEdmEquipmentItems (20171217081426)  (0.8ms) BEGIN  (6.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (2.8ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (1.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (1.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")  SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171217081426"]]  (1.4ms) COMMIT Migrating to CreateMksEdmEquipmentValuations (20171220133548)  (0.6ms) BEGIN  (6.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (2.1ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20171220133548"]]  (2.2ms) COMMIT Migrating to CreateMksEdmEquipmentComponents (20180317043420)  (0.8ms) BEGIN  (8.4ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (2.3ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")  SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20180317043420"]]  (1.9ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN  (1.0ms) COMMIT  (0.9ms) SELECT pg_advisory_unlock(8683284875916872550)  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (7.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (4.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (267.8ms) DROP DATABASE IF EXISTS "construction_test"  (603.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (5.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.3ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (57.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (10.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (7.0ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (7.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (9.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.8ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (10.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (11.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (10.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (13.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (10.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.7ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.2ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (9.4ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.3ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.6ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (4.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (4.4ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.2ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.3ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (5.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (8.8ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (8.8ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.7ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.5ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (9.2ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.7ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (26.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (6.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.8ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (6.0ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.2ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (4.0ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.1ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (9.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (3.4ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.6ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (3.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 13:58:03.262817"], ["updated_at", "2018-09-04 13:58:03.262817"]]  (1.8ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (2.3ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 13:58:03.275208"], ["key", "environment"]]  (1.4ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (130.7ms) DROP DATABASE IF EXISTS "construction_test"  (346.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (13.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT 't' NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.8ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.9ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.8ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT 't', "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (15.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (5.2ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.4ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (13.4ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.4ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (5.6ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (4.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.4ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.3ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.3ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (10.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (5.3ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.7ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (8.0ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (3.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.2ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.0ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (3.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (9.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.1ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN SQL (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:01:59.302266"], ["updated_at", "2018-09-04 14:01:59.302266"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN SQL (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:01:59.310183"], ["key", "environment"]]  (1.6ms) COMMIT  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.9ms) DROP DATABASE IF EXISTS "construction_test"  (315.1ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (16.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.5ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.3ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.6ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (4.5ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (10.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.2ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.2ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.4ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.8ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.3ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.9ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (9.3ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.3ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.7ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (9.9ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.5ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (6.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (4.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.8ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.2ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (3.9ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.9ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.5ms) 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 (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Create (1.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:13:54.182864"], ["updated_at", "2018-09-04 14:13:54.182864"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Update (1.4ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:13:54.193105"], ["key", "environment"]]  (1.5ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.3ms) DROP DATABASE IF EXISTS "construction_test"  (302.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (6.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.1ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (6.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.6ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.0ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.6ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.5ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (7.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.7ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (4.2ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.6ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.4ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.6ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.4ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.1ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (3.2ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (4.0ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (4.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.1ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:20:03.172745"], ["updated_at", "2018-09-04 14:20:03.172745"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:20:03.180816"], ["key", "environment"]]  (2.1ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.2ms) DROP DATABASE IF EXISTS "construction_test"  (328.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.3ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (4.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.4ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.8ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.8ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.2ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.2ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.6ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.4ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (4.1ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (6.1ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.4ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.0ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.0ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (11.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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 (1.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:53:39.508886"], ["updated_at", "2018-09-04 14:53:39.508886"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (2.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:53:39.519524"], ["key", "environment"]]  (1.5ms) COMMIT  (2.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (113.5ms) DROP DATABASE IF EXISTS "construction_test"  (315.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (5.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (1.1ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (5.4ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (4.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.9ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.2ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.2ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.5ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.9ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.9ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (10.5ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.3ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.5ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.3ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.7ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (8.1ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.8ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.0ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.0ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.1ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.1ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.9ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.1ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:54:59.747839"], ["updated_at", "2018-09-04 14:54:59.747839"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (1.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.3ms) BEGIN ActiveRecord::InternalMetadata Update (1.2ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:54:59.760063"], ["key", "environment"]]  (1.9ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.5ms) DROP DATABASE IF EXISTS "construction_test"  (323.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.2ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (14.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.4ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (13.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (11.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (1.2ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.4ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (1.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.2ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.8ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.7ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.5ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.5ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (8.9ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (4.7ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (5.9ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (4.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.1ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.3ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.9ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.8ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.9ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.7ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (4.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.9ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.6ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:55:23.706493"], ["updated_at", "2018-09-04 14:55:23.706493"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:55:23.714701"], ["key", "environment"]]  (1.3ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (125.3ms) DROP DATABASE IF EXISTS "construction_test"  (334.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (8.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.9ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.3ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (8.7ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.2ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (5.8ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.5ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.3ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.2ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.8ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.3ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.0ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.9ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.4ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.8ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.8ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.1ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.2ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.4ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:58:33.852424"], ["updated_at", "2018-09-04 14:58:33.852424"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:58:33.860688"], ["key", "environment"]]  (1.3ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (5.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.6ms) DROP DATABASE IF EXISTS "construction_test"  (329.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (17.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.8ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.1ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (4.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.2ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.5ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.5ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.4ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.8ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.3ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.3ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (9.1ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.1ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.6ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (8.0ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.4ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.8ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.5ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 14:59:51.427378"], ["updated_at", "2018-09-04 14:59:51.427378"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 14:59:51.435410"], ["key", "environment"]]  (1.4ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.2ms) DROP DATABASE IF EXISTS "construction_test"  (317.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (1.0ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (13.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.0ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.4ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.8ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (4.0ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.0ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.5ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.5ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (4.0ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.8ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.2ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (9.3ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.5ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.9ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.5ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.7ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (3.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.9ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.8ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.7ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:01:59.391637"], ["updated_at", "2018-09-04 15:01:59.391637"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:01:59.400639"], ["key", "environment"]]  (4.0ms) COMMIT  (2.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.2ms) DROP DATABASE IF EXISTS "construction_test"  (316.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.0ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.2ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (2.9ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.0ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.1ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (1.5ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.3ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.7ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.3ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.8ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.8ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.1ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.3ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.5ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (5.0ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (3.1ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (5.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:02:11.335352"], ["updated_at", "2018-09-04 15:02:11.335352"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:02:11.343950"], ["key", "environment"]]  (1.4ms) COMMIT  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.7ms) DROP DATABASE IF EXISTS "construction_test"  (318.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.9ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.9ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.9ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.5ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (4.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.2ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.4ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.6ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.4ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.5ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.1ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.3ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.7ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.8ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (3.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (4.1ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.1ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:07:15.047934"], ["updated_at", "2018-09-04 15:07:15.047934"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.8ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:07:15.055741"], ["key", "environment"]]  (1.6ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.7ms) DROP DATABASE IF EXISTS "construction_test"  (330.1ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.8ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (8.9ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (1.2ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.5ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.6ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.1ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.7ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.9ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.4ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.4ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.8ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (4.0ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.6ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.5ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.8ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.3ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.5ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.8ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.3ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:09:12.096899"], ["updated_at", "2018-09-04 15:09:12.096899"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.7ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:09:12.105180"], ["key", "environment"]]  (1.3ms) COMMIT  (2.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (126.0ms) DROP DATABASE IF EXISTS "construction_test"  (316.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.5ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.6ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.7ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.6ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (8.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.4ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.1ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.4ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.3ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.8ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.9ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.5ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.6ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.7ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.5ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.2ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.0ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.9ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:13:37.537140"], ["updated_at", "2018-09-04 15:13:37.537140"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:13:37.546428"], ["key", "environment"]]  (1.5ms) COMMIT  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.8ms) DROP DATABASE IF EXISTS "construction_test"  (311.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.7ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (9.4ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.8ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.7ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (8.0ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.7ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.5ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.7ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.8ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.6ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.5ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.3ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.1ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.1ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (1.0ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (11.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.1ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.9ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.6ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Create (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:16:36.356861"], ["updated_at", "2018-09-04 15:16:36.356861"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:16:36.365577"], ["key", "environment"]]  (1.4ms) COMMIT  (1.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.3ms) DROP DATABASE IF EXISTS "construction_test"  (301.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (6.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.3ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.5ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.1ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.2ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (9.4ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.6ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.2ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.5ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.2ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.6ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (8.0ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.7ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.9ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.6ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.3ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.9ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.3ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Create (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:17:30.619788"], ["updated_at", "2018-09-04 15:17:30.619788"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:17:30.629264"], ["key", "environment"]]  (1.3ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.5ms) DROP DATABASE IF EXISTS "construction_test"  (316.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.8ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.4ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.1ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.3ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (5.4ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.7ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.4ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.4ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.6ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.1ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.8ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.6ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (4.0ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.0ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.2ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN ActiveRecord::InternalMetadata Create (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:28:45.485998"], ["updated_at", "2018-09-04 15:28:45.485998"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:28:45.494377"], ["key", "environment"]]  (1.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.6ms) DROP DATABASE IF EXISTS "construction_test"  (320.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.3ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.5ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (7.1ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.1ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.7ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.4ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.8ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.3ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.9ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.4ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (4.6ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.5ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (1.1ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.4ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.8ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.8ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.0ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.0ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (1.0ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (9.0ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.2ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (4.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.9ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.1ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.1ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.7ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN ActiveRecord::InternalMetadata Create (1.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:29:31.093663"], ["updated_at", "2018-09-04 15:29:31.093663"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:29:31.102897"], ["key", "environment"]]  (1.6ms) COMMIT  (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (124.1ms) DROP DATABASE IF EXISTS "construction_test"  (318.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.1ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.2ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.5ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.9ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.3ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.6ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.2ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.7ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (6.8ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.5ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.8ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.5ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.6ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (8.0ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (9.5ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (4.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.2ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.1ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.1ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.2ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (8.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.0ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:33:12.559432"], ["updated_at", "2018-09-04 15:33:12.559432"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.8ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:33:12.568214"], ["key", "environment"]]  (1.5ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (125.6ms) DROP DATABASE IF EXISTS "construction_test"  (324.9ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.6ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.4ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.3ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.4ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.5ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.0ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.0ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.2ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (9.2ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.9ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.3ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.3ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.0ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.4ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (4.5ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.2ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.6ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (4.0ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.9ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.8ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.7ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.0ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (8.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (3.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (4.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.8ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.6ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN ActiveRecord::InternalMetadata Create (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:34:40.485153"], ["updated_at", "2018-09-04 15:34:40.485153"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:34:40.494381"], ["key", "environment"]]  (1.4ms) COMMIT  (1.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.4ms) DROP DATABASE IF EXISTS "construction_test"  (318.4ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.6ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (6.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.0ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (9.0ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (1.1ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.8ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.7ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (2.1ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.3ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (2.1ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (5.1ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.6ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.1ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.3ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.6ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.7ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.6ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.2ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (4.0ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.6ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.9ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.8ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.8ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.6ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (3.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (3.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (4.1ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (4.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (3.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.3ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (4.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.4ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (2.2ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (36.1ms) 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 (1.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:37:43.335756"], ["updated_at", "2018-09-04 15:37:43.335756"]]  (2.2ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (1.1ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:37:43.346260"], ["key", "environment"]]  (1.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.6ms) DROP DATABASE IF EXISTS "construction_test"  (315.5ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.9ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.7ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (9.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.8ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.9ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.2ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.4ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.4ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.3ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.4ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.7ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (4.1ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.9ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.9ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.9ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.6ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.5ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.4ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.9ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.5ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.2ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.5ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.7ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (9.4ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.6ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.5ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.1ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (8.1ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:38:55.415993"], ["updated_at", "2018-09-04 15:38:55.415993"]]  (1.6ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:38:55.424745"], ["key", "environment"]]  (1.3ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.2ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.6ms) DROP DATABASE IF EXISTS "construction_test"  (330.7ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (12.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.4ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (9.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.0ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.0ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.4ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.0ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (5.2ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (4.7ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (9.4ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.1ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.6ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.9ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (5.8ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.1ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (5.0ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (5.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (6.8ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.0ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (1.1ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.3ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.0ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (3.1ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.8ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.3ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.3ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Create (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:40:29.634674"], ["updated_at", "2018-09-04 15:40:29.634674"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:40:29.643112"], ["key", "environment"]]  (1.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.7ms) DROP DATABASE IF EXISTS "construction_test"  (317.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.9ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.2ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (5.3ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.8ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (7.3ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.9ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.8ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.3ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.8ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.0ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.3ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (6.9ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.6ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.2ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.3ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.5ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.5ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.1ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.9ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (4.3ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (10.8ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.0ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.4ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.6ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.2ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.5ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (8.1ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.7ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.9ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.8ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.2ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.7ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (2.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.1ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Create (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:40:54.555314"], ["updated_at", "2018-09-04 15:40:54.555314"]]  (1.4ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:40:54.563704"], ["key", "environment"]]  (1.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.9ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (123.4ms) DROP DATABASE IF EXISTS "construction_test"  (321.2ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (7.7ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.2ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.5ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (4.0ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.7ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (1.2ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (10.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.7ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.5ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.3ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.1ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.7ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (5.0ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (4.0ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (6.7ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.7ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.7ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (4.2ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.9ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.7ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.7ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.7ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.3ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.9ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.6ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (6.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.0ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (4.9ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (4.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.8ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.0ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Create (1.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:41:10.446708"], ["updated_at", "2018-09-04 15:41:10.446708"]]  (1.7ms) COMMIT ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (1.1ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:41:10.456889"], ["key", "environment"]]  (1.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (120.8ms) DROP DATABASE IF EXISTS "construction_test"  (320.0ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.8ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.1ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.4ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.3ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.8ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (6.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (9.2ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (2.5ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.6ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.0ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.1ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.3ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (6.8ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (7.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.2ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.7ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (8.7ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (6.5ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (6.9ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.2ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (7.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.7ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.4ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.2ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.6ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.4ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.8ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.5ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.1ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.7ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (4.3ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (8.9ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (6.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.1ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (4.9ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (1.1ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (9.7ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.2ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (8.9ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.2ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.1ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.6ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (4.0ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.3ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.4ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (7.3ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Create (1.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:42:00.492822"], ["updated_at", "2018-09-04 15:42:00.492822"]]  (1.5ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:42:00.501680"], ["key", "environment"]]  (1.4ms) COMMIT  (1.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (121.3ms) DROP DATABASE IF EXISTS "construction_test"  (318.6ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (11.8ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (9.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (5.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (17.4ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (11.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.0ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.7ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.1ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (7.5ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (18.9ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (10.2ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.9ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (9.4ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.8ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (7.7ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (8.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (5.1ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.6ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (7.4ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.1ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (7.1ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.8ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (4.0ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (6.1ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.6ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (3.4ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (4.3ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (7.7ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (5.4ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.7ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.1ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (7.1ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.7ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.9ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.2ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (3.8ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.3ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.1ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (3.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.8ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.5ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.9ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (6.5ms) 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.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Create (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-04 15:45:12.335932"], ["updated_at", "2018-09-04 15:45:12.335932"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (1.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.7ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-04 15:45:12.344733"], ["key", "environment"]]  (1.3ms) COMMIT  (3.5ms) 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" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (397.8ms) DROP DATABASE IF EXISTS "construction_test"  (602.3ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (1.0ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.9ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (14.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (10.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.4ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (3.4ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (8.1ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (5.4ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (8.3ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (12.1ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (35.7ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (8.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (13.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.6ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (14.5ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (8.6ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (23.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.7ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (3.6ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (11.2ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.1ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (16.7ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.4ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.0ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (18.4ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (1.1ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (10.9ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.7ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (12.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (4.6ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (8.2ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (6.4ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (1.0ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (15.0ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (12.7ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.9ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.3ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (4.2ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.3ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.8ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.8ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (8.1ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (4.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (9.6ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.5ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (14.3ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (9.3ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.8ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (16.3ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (10.2ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (1.3ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (10.6ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.7ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.1ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.8ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.5ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (3.7ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.6ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.8ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.9ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.0ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (3.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (7.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.6ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (3.3ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.7ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.9ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (10.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.5ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (9.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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Create (3.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-05 05:05:42.953022"], ["updated_at", "2018-09-05 05:05:42.953022"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.7ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Update (0.9ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-05 05:05:42.963676"], ["key", "environment"]]  (1.5ms) COMMIT  (1.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.7ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (1.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.8ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.5ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (122.6ms) DROP DATABASE IF EXISTS "construction_test"  (510.6ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (15.3ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (12.5ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.0ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (8.6ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (5.6ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (16.6ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (8.7ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.6ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (3.7ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.7ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (3.6ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (9.7ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.5ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (9.8ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.9ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (11.1ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.5ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (4.8ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (7.0ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (9.2ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (10.1ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (11.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.6ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (11.0ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (11.6ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (5.0ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.7ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.4ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (9.2ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.8ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (6.8ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (3.5ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (8.8ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (5.2ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (8.0ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.9ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (7.6ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (5.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (12.5ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.4ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (14.6ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (4.7ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.1ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (5.0ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.8ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (10.9ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.5ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (16.2ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (2.4ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.0ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.2ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.8ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.5ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (2.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.7ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (4.1ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.9ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.6ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (7.8ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (14.9ms) 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.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.6ms) BEGIN ActiveRecord::InternalMetadata Create (1.0ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-05 05:06:17.971257"], ["updated_at", "2018-09-05 05:06:17.971257"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.5ms) BEGIN ActiveRecord::InternalMetadata Update (1.0ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-05 05:06:17.979510"], ["key", "environment"]]  (1.4ms) COMMIT  (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (0.9ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (0.6ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 [["key", "environment"]]  (114.5ms) DROP DATABASE IF EXISTS "construction_test"  (323.8ms) CREATE DATABASE "construction_test" ENCODING = 'utf8' SQL (0.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (0.6ms) DROP TABLE IF EXISTS "mks_auth_application_modules" CASCADE  (10.7ms) CREATE TABLE "mks_auth_application_modules" ("id" serial NOT NULL PRIMARY KEY, "code" character varying NOT NULL, "name" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.9ms) DROP TABLE IF EXISTS "mks_auth_menus" CASCADE  (15.1ms) CREATE TABLE "mks_auth_menus" ("id" serial NOT NULL PRIMARY KEY, "text" character varying NOT NULL, "icon_cls" character varying, "class_name" character varying, "location" character varying, "parent_id" integer, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "index_mks_auth_menus_on_application_module_id" ON "mks_auth_menus" ("application_module_id")  (4.7ms) CREATE INDEX "index_mks_auth_menus_on_parent_id" ON "mks_auth_menus" ("parent_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_menus_user_roles" CASCADE  (4.9ms) CREATE TABLE "mks_auth_menus_user_roles" ("id" serial NOT NULL PRIMARY KEY, "menu_id" integer, "user_role_id" integer)  (4.8ms) CREATE INDEX "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" ON "mks_auth_menus_user_roles" ("menu_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_auth_user_roles" CASCADE  (11.5ms) CREATE TABLE "mks_auth_user_roles" ("id" serial NOT NULL PRIMARY KEY, "name" character varying NOT NULL, "application_module_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "index_mks_auth_user_roles_on_application_module_id" ON "mks_auth_user_roles" ("application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users" CASCADE  (10.4ms) CREATE TABLE "mks_auth_users" ("id" serial NOT NULL PRIMARY KEY, "first_name" character varying NOT NULL, "last_name" character varying NOT NULL, "email" character varying NOT NULL, "active" boolean DEFAULT TRUE NOT NULL, "password_digest" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_application_modules" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_application_modules" ("user_id" bigint, "application_module_id" bigint)  (11.3ms) CREATE INDEX "am_on_users_indx" ON "mks_auth_users_application_modules" ("user_id", "application_module_id")  (0.7ms) DROP TABLE IF EXISTS "mks_auth_users_user_roles" CASCADE  (1.9ms) CREATE TABLE "mks_auth_users_user_roles" ("user_id" integer, "user_role_id" integer)  (4.8ms) CREATE INDEX "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" ON "mks_auth_users_user_roles" ("user_id", "user_role_id")  (0.6ms) DROP TABLE IF EXISTS "mks_edm_equipment_categories" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipment_categories" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "equipment_type_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.9ms) CREATE INDEX "ec_on_et_indx" ON "mks_edm_equipment_categories" ("equipment_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_components" CASCADE  (8.4ms) CREATE TABLE "mks_edm_equipment_components" ("id" bigserial primary key, "serial_no" character varying, "name" character varying NOT NULL, "equipment_item_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "ei_on_ec_indx" ON "mks_edm_equipment_components" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_items" CASCADE  (20.6ms) CREATE TABLE "mks_edm_equipment_items" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "status" character varying DEFAULT 'READY', "serial_number" character varying, "brand" character varying, "item_model" character varying, "purchase_price" float NOT NULL, "purchase_date" date NOT NULL, "license_fee" float, "tax" float, "equipment_id" bigint, "current_location_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.8ms) CREATE INDEX "equipment_on_el_indx" ON "mks_edm_equipment_items" ("current_location_id")  (5.0ms) CREATE INDEX "equipment_on_ei_indx" ON "mks_edm_equipment_items" ("equipment_id")  (0.9ms) DROP TABLE IF EXISTS "mks_edm_equipment_locations" CASCADE  (10.7ms) CREATE TABLE "mks_edm_equipment_locations" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "location_type_id" bigint, "description" character varying, "address" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.4ms) CREATE INDEX "lt_on_el_indx" ON "mks_edm_equipment_locations" ("location_type_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_types" CASCADE  (8.2ms) CREATE TABLE "mks_edm_equipment_types" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipment_valuations" CASCADE  (8.2ms) CREATE TABLE "mks_edm_equipment_valuations" ("id" bigserial primary key, "equipment_item_id" bigint, "initial_cost" float NOT NULL, "residual_value" float NOT NULL, "work_hrs_per_yr" float NOT NULL, "life_year" float NOT NULL, "insurance_premium" float NOT NULL, "fuel_cost_per_hr" float, "oil_rate" float, "repair_rate" float, "rate_of_return" float, "dep_method" character varying, "is_current" boolean DEFAULT TRUE, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.5ms) CREATE INDEX "ev_on_ei_indx" ON "mks_edm_equipment_valuations" ("equipment_item_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_equipments" CASCADE  (8.6ms) CREATE TABLE "mks_edm_equipments" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "minimum_acquisition_time" float DEFAULT 0.0 NOT NULL, "equipment_category_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.4ms) CREATE INDEX "equipment_on_ec_indx" ON "mks_edm_equipments" ("equipment_category_id")  (0.7ms) DROP TABLE IF EXISTS "mks_edm_location_types" CASCADE  (6.9ms) CREATE TABLE "mks_edm_location_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "description" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_bundle_discounts" CASCADE  (6.3ms) CREATE TABLE "mks_rate_bundle_discounts" ("id" bigserial primary key, "chargeable_service_id" bigint, "service_bundle_id" bigint, "percent_discount" float NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.5ms) CREATE INDEX "cs_on_bd_indx" ON "mks_rate_bundle_discounts" ("chargeable_service_id")  (3.7ms) CREATE INDEX "sb_on_bd_indx" ON "mks_rate_bundle_discounts" ("service_bundle_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_service_discounts" CASCADE  (13.5ms) CREATE TABLE "mks_rate_chargeable_service_discounts" ("id" bigserial primary key, "unit_variable" character varying NOT NULL, "from" float NOT NULL, "to" float NOT NULL, "value" float NOT NULL, "chargeable_service_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.6ms) DROP TABLE IF EXISTS "mks_rate_chargeable_services" CASCADE  (8.1ms) CREATE TABLE "mks_rate_chargeable_services" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "service_type_id" integer, "base_unit_id" integer, "utilization_unit_id" integer, "service_delivery_unit_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.3ms) CREATE INDEX "bu_on_cs_indx" ON "mks_rate_chargeable_services" ("base_unit_id")  (4.7ms) CREATE INDEX "sdu_on_cs_indx" ON "mks_rate_chargeable_services" ("service_delivery_unit_id")  (3.6ms) CREATE INDEX "st_on_cs_indx" ON "mks_rate_chargeable_services" ("service_type_id")  (3.4ms) CREATE INDEX "uu_on_cs_indx" ON "mks_rate_chargeable_services" ("utilization_unit_id")  (0.7ms) DROP TABLE IF EXISTS "mks_rate_rate_change_requests" CASCADE  (7.5ms) CREATE TABLE "mks_rate_rate_change_requests" ("id" bigserial primary key, "reference_number" character varying, "authorized_by" character varying NOT NULL, "effective_on" date NOT NULL, "authorized_on" date NOT NULL, "rates" json NOT NULL, "status" character varying DEFAULT 'SUBMITTED' NOT NULL, "created_by_id" bigint, "approved_by_id" bigint, "remark" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (6.3ms) CREATE INDEX "ab_on_rcr_indx" ON "mks_rate_rate_change_requests" ("approved_by_id")  (5.0ms) CREATE INDEX "cb_on_rcr_indx" ON "mks_rate_rate_change_requests" ("created_by_id")  (3.4ms) CREATE UNIQUE INDEX "index_mks_rate_rate_change_requests_on_reference_number" ON "mks_rate_rate_change_requests" ("reference_number")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_bundles" CASCADE  (13.6ms) CREATE TABLE "mks_rate_service_bundles" ("id" bigserial primary key, "code" character varying, "name" character varying NOT NULL, "description" character varying, "service_delivery_unit_id" bigint, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (5.9ms) CREATE INDEX "sdu_on_sb_indx" ON "mks_rate_service_bundles" ("service_delivery_unit_id")  (0.9ms) DROP TABLE IF EXISTS "mks_rate_service_delivery_units" CASCADE  (15.2ms) CREATE TABLE "mks_rate_service_delivery_units" ("id" bigserial primary key, "code" character varying NOT NULL, "name" character varying NOT NULL, "address" character varying NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_service_rates" CASCADE  (6.5ms) CREATE TABLE "mks_rate_service_rates" ("id" bigserial primary key, "chargeable_service_id" bigint, "equipment_item_id" bigint, "base_rate" float DEFAULT 0.0, "utilization_rate" float DEFAULT 0.0, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (4.8ms) CREATE INDEX "cs_on_sr_indx" ON "mks_rate_service_rates" ("chargeable_service_id")  (3.5ms) CREATE INDEX "cs_on_ei_indx" ON "mks_rate_service_rates" ("equipment_item_id")  (0.6ms) DROP TABLE IF EXISTS "mks_rate_service_types" CASCADE  (7.9ms) CREATE TABLE "mks_rate_service_types" ("id" bigserial primary key, "code" character varying, "name" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (0.7ms) DROP TABLE IF EXISTS "mks_rate_unit_of_charges" CASCADE  (8.3ms) CREATE TABLE "mks_rate_unit_of_charges" ("id" bigserial primary key, "name" character varying NOT NULL, "unit_variables" json NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)  (3.3ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_e5dd25fcb5" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.6ms) ALTER TABLE "mks_auth_menus" ADD CONSTRAINT "fk_rails_826b2757bc" FOREIGN KEY ("parent_id") REFERENCES "mks_auth_menus" ("id")   (3.2ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_1807c05e36" FOREIGN KEY ("menu_id") REFERENCES "mks_auth_menus" ("id")   (2.7ms) ALTER TABLE "mks_auth_menus_user_roles" ADD CONSTRAINT "fk_rails_c24fca59c0" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.3ms) ALTER TABLE "mks_auth_user_roles" ADD CONSTRAINT "fk_rails_b0b293e4e2" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_b100f8542c" FOREIGN KEY ("application_module_id") REFERENCES "mks_auth_application_modules" ("id")   (2.5ms) ALTER TABLE "mks_auth_users_application_modules" ADD CONSTRAINT "fk_rails_1010e0182a" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_3dae904cd8" FOREIGN KEY ("user_role_id") REFERENCES "mks_auth_user_roles" ("id")   (2.4ms) ALTER TABLE "mks_auth_users_user_roles" ADD CONSTRAINT "fk_rails_7cc19890aa" FOREIGN KEY ("user_id") REFERENCES "mks_auth_users" ("id")   (3.3ms) ALTER TABLE "mks_edm_equipment_categories" ADD CONSTRAINT "fk_rails_37d48f9db9" FOREIGN KEY ("equipment_type_id") REFERENCES "mks_edm_equipment_types" ("id")   (2.9ms) ALTER TABLE "mks_edm_equipment_components" ADD CONSTRAINT "fk_rails_df30d7c6f8" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.6ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_c0b56e395b" FOREIGN KEY ("current_location_id") REFERENCES "mks_edm_equipment_locations" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_items" ADD CONSTRAINT "fk_rails_9c44a32cfe" FOREIGN KEY ("equipment_id") REFERENCES "mks_edm_equipments" ("id")   (3.0ms) ALTER TABLE "mks_edm_equipment_locations" ADD CONSTRAINT "fk_rails_4117320862" FOREIGN KEY ("location_type_id") REFERENCES "mks_edm_location_types" ("id")   (2.7ms) ALTER TABLE "mks_edm_equipment_valuations" ADD CONSTRAINT "fk_rails_b09a0ab3c3" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (3.4ms) ALTER TABLE "mks_edm_equipments" ADD CONSTRAINT "fk_rails_59110db010" FOREIGN KEY ("equipment_category_id") REFERENCES "mks_edm_equipment_categories" ("id")   (3.5ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_e6bce7b79c" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (3.7ms) ALTER TABLE "mks_rate_bundle_discounts" ADD CONSTRAINT "fk_rails_72a3777128" FOREIGN KEY ("service_bundle_id") REFERENCES "mks_rate_service_bundles" ("id")   (2.6ms) ALTER TABLE "mks_rate_chargeable_service_discounts" ADD CONSTRAINT "fk_rails_688682e0b5" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (2.4ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_4e0ff36276" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (2.3ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_c9195a9eb4" FOREIGN KEY ("service_type_id") REFERENCES "mks_rate_service_types" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_323d899c02" FOREIGN KEY ("base_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (2.5ms) ALTER TABLE "mks_rate_chargeable_services" ADD CONSTRAINT "fk_rails_a4bbde1129" FOREIGN KEY ("utilization_unit_id") REFERENCES "mks_rate_unit_of_charges" ("id")   (3.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_1ec309ecbf" FOREIGN KEY ("approved_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_rate_change_requests" ADD CONSTRAINT "fk_rails_c0525c8963" FOREIGN KEY ("created_by_id") REFERENCES "mks_auth_users" ("id")   (2.4ms) ALTER TABLE "mks_rate_service_bundles" ADD CONSTRAINT "fk_rails_d6c823a60f" FOREIGN KEY ("service_delivery_unit_id") REFERENCES "mks_rate_service_delivery_units" ("id")   (3.5ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_8f0c330d29" FOREIGN KEY ("equipment_item_id") REFERENCES "mks_edm_equipment_items" ("id")   (2.8ms) ALTER TABLE "mks_rate_service_rates" ADD CONSTRAINT "fk_rails_a39cc6503a" FOREIGN KEY ("chargeable_service_id") REFERENCES "mks_rate_chargeable_services" ("id")   (6.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)  (1.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES (20180317043420)  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES (20171215080758), (20171215081601), (20171216024320), (20171216041414), (20171216070855), (20171217081426), (20171220133548);   (10.6ms) 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.9ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (0.9ms) BEGIN ActiveRecord::InternalMetadata Create (1.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-09-05 05:07:09.714920"], ["updated_at", "2018-09-05 05:07:09.714920"]]  (1.3ms) COMMIT ActiveRecord::InternalMetadata Load (0.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]  (2.3ms) BEGIN ActiveRecord::InternalMetadata Update (1.1ms) UPDATE "ar_internal_metadata" SET "value" = $1, "updated_at" = $2 WHERE "ar_internal_metadata"."key" = $3 [["value", "test"], ["updated_at", "2018-09-05 05:07:09.725663"], ["key", "environment"]]  (1.3ms) COMMIT