From 1a2dca5386b057241e2afe2cb0230b9394771039 Mon Sep 17 00:00:00 2001 From: Eisuke Oishi Date: Fri, 28 Apr 2017 14:47:01 +0900 Subject: [PATCH 1/4] Add slim to dependency --- kuroko2.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/kuroko2.gemspec b/kuroko2.gemspec index b041deaa..26bc97e1 100644 --- a/kuroko2.gemspec +++ b/kuroko2.gemspec @@ -26,6 +26,7 @@ Gem::Specification.new do |s| s.add_dependency 'retryable' s.add_dependency 'faraday' s.add_dependency 'sprockets' + s.add_dependency 'slim' s.add_dependency 'slim-rails' s.add_dependency 'sass', '~> 3.4.5' s.add_dependency 'sass-rails' From befff65b3e58d52f3c7c356199d69d8a1d584b6e Mon Sep 17 00:00:00 2001 From: Eisuke Oishi Date: Mon, 8 May 2017 13:58:43 +0900 Subject: [PATCH 2/4] Prevent ActionController::UnfilteredParameters error --- app/controllers/kuroko2/api/job_instances_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/kuroko2/api/job_instances_controller.rb b/app/controllers/kuroko2/api/job_instances_controller.rb index db3c1a60..0f9a2f00 100644 --- a/app/controllers/kuroko2/api/job_instances_controller.rb +++ b/app/controllers/kuroko2/api/job_instances_controller.rb @@ -3,7 +3,7 @@ class Kuroko2::Api::JobInstancesController < Kuroko2::Api::ApplicationController validates :create do hash :env, description: 'Env variables to launch an instance' do |env| - env.to_h.all? { |_, v| v.is_a?(String) } + env.values.all? { |v| v.is_a?(String) } end end From b732d818f19634155275dd575d47258fb7dd9612 Mon Sep 17 00:00:00 2001 From: Eisuke Oishi Date: Tue, 9 May 2017 10:48:17 +0900 Subject: [PATCH 3/4] Set ActiveRecord::Migration version [rails 5.1.0] Directly inheriting from ActiveRecord::Migration is not supported. --- db/migrate/001_create_job_definitions.rb | 2 +- db/migrate/002_create_job_instances.rb | 2 +- db/migrate/003_create_job_schedules.rb | 2 +- db/migrate/004_create_ticks.rb | 2 +- db/migrate/005_create_logs.rb | 2 +- db/migrate/006_create_tokens.rb | 2 +- db/migrate/007_create_executions.rb | 2 +- db/migrate/008_create_process_signals.rb | 2 +- db/migrate/009_create_users.rb | 2 +- db/migrate/010_create_admin_assignments.rb | 2 +- db/migrate/011_create_stars.rb | 2 +- db/migrate/012_create_workers.rb | 2 +- db/migrate/018_create_job_definition_tags.rb | 2 +- db/migrate/019_create_tags.rb | 2 +- db/migrate/021_create_memory_expectancies.rb | 2 +- .../025_create_job_suspend_schedules.rb | 2 +- .../026_add_webhook_url_to_job_definitions.rb | 2 +- .../027_drop_uniq_constraint_user_email.rb | 2 +- spec/dummy/db/schema.rb | 394 +++++++++++++----- 19 files changed, 308 insertions(+), 122 deletions(-) diff --git a/db/migrate/001_create_job_definitions.rb b/db/migrate/001_create_job_definitions.rb index 7f9f9145..1c0ae9d4 100644 --- a/db/migrate/001_create_job_definitions.rb +++ b/db/migrate/001_create_job_definitions.rb @@ -1,4 +1,4 @@ -class CreateJobDefinitions < ActiveRecord::Migration +class CreateJobDefinitions < ActiveRecord::Migration[5.0] def change create_table "job_definitions" do |t| t.integer "version", limit: 4, default: 0, null: false diff --git a/db/migrate/002_create_job_instances.rb b/db/migrate/002_create_job_instances.rb index deaa79ec..aef78781 100644 --- a/db/migrate/002_create_job_instances.rb +++ b/db/migrate/002_create_job_instances.rb @@ -1,4 +1,4 @@ -class CreateJobInstances < ActiveRecord::Migration +class CreateJobInstances < ActiveRecord::Migration[5.0] def change create_table "job_instances" do |t| t.integer "job_definition_id", limit: 4 diff --git a/db/migrate/003_create_job_schedules.rb b/db/migrate/003_create_job_schedules.rb index 1b8a316c..147d2b91 100644 --- a/db/migrate/003_create_job_schedules.rb +++ b/db/migrate/003_create_job_schedules.rb @@ -1,4 +1,4 @@ -class CreateJobSchedules < ActiveRecord::Migration +class CreateJobSchedules < ActiveRecord::Migration[5.0] def change create_table "job_schedules" do |t| t.integer "job_definition_id", limit: 4 diff --git a/db/migrate/004_create_ticks.rb b/db/migrate/004_create_ticks.rb index 1576faf4..85de0789 100644 --- a/db/migrate/004_create_ticks.rb +++ b/db/migrate/004_create_ticks.rb @@ -1,4 +1,4 @@ -class CreateTicks < ActiveRecord::Migration +class CreateTicks < ActiveRecord::Migration[5.0] def change create_table "ticks" do |t| t.datetime "at" diff --git a/db/migrate/005_create_logs.rb b/db/migrate/005_create_logs.rb index cbd58763..93a8ed3a 100644 --- a/db/migrate/005_create_logs.rb +++ b/db/migrate/005_create_logs.rb @@ -1,4 +1,4 @@ -class CreateLogs < ActiveRecord::Migration +class CreateLogs < ActiveRecord::Migration[5.0] def change create_table "logs" do |t| t.integer "job_instance_id", limit: 4 diff --git a/db/migrate/006_create_tokens.rb b/db/migrate/006_create_tokens.rb index f50509c4..c2308c65 100644 --- a/db/migrate/006_create_tokens.rb +++ b/db/migrate/006_create_tokens.rb @@ -1,4 +1,4 @@ -class CreateTokens < ActiveRecord::Migration +class CreateTokens < ActiveRecord::Migration[5.0] def change create_table "tokens" do |t| t.string "uuid", limit: 36, null: false diff --git a/db/migrate/007_create_executions.rb b/db/migrate/007_create_executions.rb index 324180da..62ef3ac9 100644 --- a/db/migrate/007_create_executions.rb +++ b/db/migrate/007_create_executions.rb @@ -1,4 +1,4 @@ -class CreateExecutions < ActiveRecord::Migration +class CreateExecutions < ActiveRecord::Migration[5.0] def change create_table "executions" do |t| t.string "uuid", limit: 36, null: false diff --git a/db/migrate/008_create_process_signals.rb b/db/migrate/008_create_process_signals.rb index 26ca225a..01e80be9 100644 --- a/db/migrate/008_create_process_signals.rb +++ b/db/migrate/008_create_process_signals.rb @@ -1,4 +1,4 @@ -class CreateProcessSignals < ActiveRecord::Migration +class CreateProcessSignals < ActiveRecord::Migration[5.0] def change create_table "process_signals" do |t| t.string "hostname", limit: 180, default: "", null: false diff --git a/db/migrate/009_create_users.rb b/db/migrate/009_create_users.rb index f63c3a3d..faa0888f 100644 --- a/db/migrate/009_create_users.rb +++ b/db/migrate/009_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration +class CreateUsers < ActiveRecord::Migration[5.0] def change create_table "users" do |t| t.string "provider", limit: 180, default: "google_oauth2", null: false diff --git a/db/migrate/010_create_admin_assignments.rb b/db/migrate/010_create_admin_assignments.rb index 640db62c..6388f3ce 100644 --- a/db/migrate/010_create_admin_assignments.rb +++ b/db/migrate/010_create_admin_assignments.rb @@ -1,4 +1,4 @@ -class CreateAdminAssignments < ActiveRecord::Migration +class CreateAdminAssignments < ActiveRecord::Migration[5.0] def change create_table "admin_assignments" do |t| t.integer "user_id", limit: 4, null: false diff --git a/db/migrate/011_create_stars.rb b/db/migrate/011_create_stars.rb index ec5d2ed0..896df1f9 100644 --- a/db/migrate/011_create_stars.rb +++ b/db/migrate/011_create_stars.rb @@ -1,4 +1,4 @@ -class CreateStars < ActiveRecord::Migration +class CreateStars < ActiveRecord::Migration[5.0] def change create_table "stars" do |t| t.integer "user_id", limit: 4, null: false diff --git a/db/migrate/012_create_workers.rb b/db/migrate/012_create_workers.rb index c4b1a268..f5c8ba8d 100644 --- a/db/migrate/012_create_workers.rb +++ b/db/migrate/012_create_workers.rb @@ -1,4 +1,4 @@ -class CreateWorkers < ActiveRecord::Migration +class CreateWorkers < ActiveRecord::Migration[5.0] def change create_table "workers" do |t| t.string "hostname", limit: 180, null: false diff --git a/db/migrate/018_create_job_definition_tags.rb b/db/migrate/018_create_job_definition_tags.rb index 62f56851..e3f96e58 100644 --- a/db/migrate/018_create_job_definition_tags.rb +++ b/db/migrate/018_create_job_definition_tags.rb @@ -1,4 +1,4 @@ -class CreateJobDefinitionTags < ActiveRecord::Migration +class CreateJobDefinitionTags < ActiveRecord::Migration[5.0] def change create_table "job_definition_tags" do |t| t.integer "job_definition_id", limit: 4, null: false diff --git a/db/migrate/019_create_tags.rb b/db/migrate/019_create_tags.rb index ac39da12..dc41f3db 100644 --- a/db/migrate/019_create_tags.rb +++ b/db/migrate/019_create_tags.rb @@ -1,4 +1,4 @@ -class CreateTags < ActiveRecord::Migration +class CreateTags < ActiveRecord::Migration[5.0] def change create_table "tags" do |t| t.string "name", limit: 100, null: false diff --git a/db/migrate/021_create_memory_expectancies.rb b/db/migrate/021_create_memory_expectancies.rb index 52d8e08c..4e7cdf8b 100644 --- a/db/migrate/021_create_memory_expectancies.rb +++ b/db/migrate/021_create_memory_expectancies.rb @@ -1,4 +1,4 @@ -class CreateMemoryExpectancies < ActiveRecord::Migration +class CreateMemoryExpectancies < ActiveRecord::Migration[5.0] def change create_table :memory_expectancies do |t| t.integer :expected_value, null: false, default: 0 diff --git a/db/migrate/025_create_job_suspend_schedules.rb b/db/migrate/025_create_job_suspend_schedules.rb index 080ac2cb..b7f28177 100644 --- a/db/migrate/025_create_job_suspend_schedules.rb +++ b/db/migrate/025_create_job_suspend_schedules.rb @@ -1,4 +1,4 @@ -class CreateJobSuspendSchedules < ActiveRecord::Migration +class CreateJobSuspendSchedules < ActiveRecord::Migration[5.0] def change create_table "job_suspend_schedules" do |t| t.integer "job_definition_id", limit: 4 diff --git a/db/migrate/026_add_webhook_url_to_job_definitions.rb b/db/migrate/026_add_webhook_url_to_job_definitions.rb index 67bcdbf5..7d3fcedb 100644 --- a/db/migrate/026_add_webhook_url_to_job_definitions.rb +++ b/db/migrate/026_add_webhook_url_to_job_definitions.rb @@ -1,4 +1,4 @@ -class AddWebhookUrlToJobDefinitions < ActiveRecord::Migration +class AddWebhookUrlToJobDefinitions < ActiveRecord::Migration[5.0] def change add_column :job_definitions, :webhook_url, :text end diff --git a/db/migrate/027_drop_uniq_constraint_user_email.rb b/db/migrate/027_drop_uniq_constraint_user_email.rb index 1f33b628..10ad61e2 100644 --- a/db/migrate/027_drop_uniq_constraint_user_email.rb +++ b/db/migrate/027_drop_uniq_constraint_user_email.rb @@ -1,4 +1,4 @@ -class DropUniqConstraintUserEmail < ActiveRecord::Migration +class DropUniqConstraintUserEmail < ActiveRecord::Migration[5.0] def up remove_index :users, name: "email" add_index :users, :email, name: "email", using: :btree diff --git a/spec/dummy/db/schema.rb b/spec/dummy/db/schema.rb index 97077a81..3acb8b74 100644 --- a/spec/dummy/db/schema.rb +++ b/spec/dummy/db/schema.rb @@ -13,141 +13,327 @@ ActiveRecord::Schema.define(version: 28) do create_table "admin_assignments", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "user_id", null: false - t.integer "job_definition_id", null: false + t.integer "user_id", null: false + t.integer "job_definition_id", null: false t.datetime "created_at" t.datetime "updated_at" - t.index ["user_id", "job_definition_id"], name: "user_id", unique: true, using: :btree + t.index ["user_id", "job_definition_id"], name: "user_id", unique: true end create_table "executions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.string "uuid", limit: 36, null: false - t.integer "job_definition_id" - t.integer "job_definition_version" - t.integer "job_instance_id" - t.integer "token_id" - t.string "queue", limit: 180, default: "@default", null: false - t.text "shell", limit: 65535, null: false - t.text "context", limit: 65535, null: false - t.integer "pid" - t.text "output", limit: 4294967295 - t.integer "exit_status", limit: 2 - t.integer "term_signal", limit: 1 + t.string "uuid", limit: 36, null: false + t.integer "job_definition_id" + t.integer "job_definition_version" + t.integer "job_instance_id" + t.integer "token_id" + t.string "queue", limit: 180, default: "@default", null: false + t.text "shell", null: false + t.text "context", null: false + t.integer "pid" + t.text "output", limit: 4294967295 + t.integer "exit_status", limit: 2 + t.integer "term_signal", limit: 1 t.datetime "started_at" t.datetime "finished_at" t.datetime "mailed_at" t.datetime "created_at" t.datetime "updated_at" - t.index ["job_definition_id", "token_id"], name: "index_kuroko2_executions_on_job_definition_id_and_token_id", unique: true, using: :btree - t.index ["started_at"], name: "started_at", using: :btree + t.index ["job_definition_id", "token_id"], name: "index_kuroko2_executions_on_job_definition_id_and_token_id", unique: true + t.index ["started_at"], name: "started_at" end create_table "job_definition_tags", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "job_definition_id", null: false - t.integer "tag_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["job_definition_id", "tag_id"], name: "kuroko2_definition_tag_idx", unique: true, using: :btree - t.index ["tag_id"], name: "job_definition_tags_tag_id", using: :btree + t.integer "job_definition_id", null: false + t.integer "tag_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_definition_id", "tag_id"], name: "kuroko2_definition_tag_idx", unique: true + t.index ["tag_id"], name: "job_definition_tags_tag_id" end create_table "job_definitions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "version", default: 0, null: false - t.string "name", limit: 180, null: false - t.text "description", limit: 65535, null: false - t.text "script", limit: 65535, null: false - t.boolean "suspended", default: false, null: false - t.integer "prevent_multi", default: 1, null: false - t.boolean "notify_cancellation", default: true, null: false - t.string "hipchat_room", limit: 180, default: "", null: false - t.boolean "hipchat_notify_finished", default: true, null: false - t.string "hipchat_additional_text", limit: 180 - t.string "slack_channel", limit: 180, default: "", null: false - t.boolean "api_allowed", default: false, null: false + t.integer "version", default: 0, null: false + t.string "name", limit: 180, null: false + t.text "description", null: false + t.text "script", null: false + t.boolean "suspended", default: false, null: false + t.integer "prevent_multi", default: 1, null: false + t.boolean "notify_cancellation", default: true, null: false + t.string "hipchat_room", limit: 180, default: "", null: false + t.boolean "hipchat_notify_finished", default: true, null: false + t.string "hipchat_additional_text", limit: 180 + t.string "slack_channel", limit: 180, default: "", null: false + t.boolean "api_allowed", default: false, null: false t.datetime "created_at" t.datetime "updated_at" - t.text "webhook_url", limit: 65535 - t.index ["name"], name: "name", using: :btree + t.text "webhook_url" + t.index ["name"], name: "name" end create_table "job_instances", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "job_definition_id" - t.integer "job_definition_version" - t.text "script", limit: 65535 + t.integer "job_definition_id" + t.integer "job_definition_version" + t.text "script" t.datetime "finished_at" t.datetime "canceled_at" t.datetime "error_at" t.datetime "created_at" t.datetime "updated_at" - t.index ["finished_at", "canceled_at", "job_definition_id"], name: "job_instance_idx", using: :btree - t.index ["job_definition_id"], name: "index_kuroko2_job_instances_on_job_definition_id", using: :btree + t.index ["finished_at", "canceled_at", "job_definition_id"], name: "job_instance_idx" + t.index ["job_definition_id"], name: "index_kuroko2_job_instances_on_job_definition_id" end create_table "job_schedules", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "job_definition_id" - t.string "cron", limit: 180 + t.integer "job_definition_id" + t.string "cron", limit: 180 t.datetime "created_at" t.datetime "updated_at" - t.index ["job_definition_id", "cron"], name: "kuroko2_schedules_definition_id_cron_idx", unique: true, using: :btree + t.index ["job_definition_id", "cron"], name: "kuroko2_schedules_definition_id_cron_idx", unique: true end create_table "job_suspend_schedules", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "job_definition_id" - t.string "cron", limit: 180 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["job_definition_id", "cron"], name: "kuroko2_suspend_schedules_definition_id_cron_idx", unique: true, using: :btree + t.integer "job_definition_id" + t.string "cron", limit: 180 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_definition_id", "cron"], name: "kuroko2_suspend_schedules_definition_id_cron_idx", unique: true + end + + create_table "admin_assignments", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "user_id", null: false + t.integer "job_definition_id", null: false + t.datetime "created_at" + t.datetime "updated_at" + t.index ["user_id", "job_definition_id"], name: "user_id", unique: true + end + + create_table "executions", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.string "uuid", limit: 36, null: false + t.integer "job_definition_id" + t.integer "job_definition_version" + t.integer "job_instance_id" + t.integer "token_id" + t.string "queue", limit: 180, default: "@default", null: false + t.text "shell", null: false + t.text "context", null: false + t.integer "pid" + t.text "output", limit: 4294967295 + t.integer "exit_status", limit: 2 + t.integer "term_signal", limit: 1 + t.datetime "started_at" + t.datetime "finished_at" + t.datetime "mailed_at" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["job_definition_id", "token_id"], name: "index_kuroko2_executions_on_job_definition_id_and_token_id", unique: true + t.index ["started_at"], name: "started_at" + end + + create_table "job_definition_tags", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "job_definition_id", null: false + t.integer "tag_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_definition_id", "tag_id"], name: "kuroko2_definition_tag_idx", unique: true + t.index ["tag_id"], name: "job_definition_tags_tag_id" + end + + create_table "job_definitions", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "version", default: 0, null: false + t.string "name", limit: 180, null: false + t.text "description", null: false + t.text "script", null: false + t.boolean "suspended", default: false, null: false + t.integer "prevent_multi", default: 1, null: false + t.boolean "notify_cancellation", default: true, null: false + t.string "hipchat_room", limit: 180, default: "", null: false + t.boolean "hipchat_notify_finished", default: true, null: false + t.string "hipchat_additional_text", limit: 180 + t.string "slack_channel", limit: 180, default: "", null: false + t.boolean "api_allowed", default: false, null: false + t.datetime "created_at" + t.datetime "updated_at" + t.text "webhook_url" + t.index ["name"], name: "name" + end + + create_table "job_instances", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "job_definition_id" + t.integer "job_definition_version" + t.text "script" + t.datetime "finished_at" + t.datetime "canceled_at" + t.datetime "error_at" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["finished_at", "canceled_at", "job_definition_id"], name: "job_instance_idx" + t.index ["job_definition_id"], name: "index_kuroko2_job_instances_on_job_definition_id" + end + + create_table "job_schedules", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "job_definition_id" + t.string "cron", limit: 180 + t.datetime "created_at" + t.datetime "updated_at" + t.index ["job_definition_id", "cron"], name: "kuroko2_schedules_definition_id_cron_idx", unique: true + end + + create_table "job_suspend_schedules", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "job_definition_id" + t.string "cron", limit: 180 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_definition_id", "cron"], name: "kuroko2_suspend_schedules_definition_id_cron_idx", unique: true + end + + create_table "logs", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "job_instance_id" + t.string "level", limit: 10 + t.text "message", limit: 4294967295 + t.datetime "created_at" + t.datetime "updated_at" + t.index ["job_instance_id"], name: "job_instance_id" + end + + create_table "memory_consumption_logs", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "job_instance_id" + t.integer "value", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_instance_id"], name: "index_kuroko2_memory_consumption_logs_on_job_instance_id" + end + + create_table "memory_expectancies", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "expected_value", default: 0, null: false + t.integer "job_definition_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_definition_id"], name: "index_kuroko2_memory_expectancies_on_job_definition_id" + end + + create_table "process_signals", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.string "hostname", limit: 180, default: "", null: false + t.integer "pid", null: false + t.integer "number", limit: 1, default: 15, null: false + t.datetime "started_at" + t.datetime "created_at" + t.datetime "updated_at" + t.text "message" + t.index ["hostname", "started_at"], name: "hostname_started_at" + end + + create_table "stars", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.integer "user_id", null: false + t.integer "job_definition_id", null: false + t.datetime "created_at" + t.datetime "updated_at" + t.index ["user_id", "job_definition_id"], name: "index_kuroko2_stars_on_user_id_and_job_definition_id", unique: true + end + + create_table "tags", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.string "name", limit: 100, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_kuroko2_tags_on_name", unique: true + end + + create_table "ticks", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.datetime "at" + end + + create_table "tokens", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.string "uuid", limit: 36, null: false + t.integer "job_definition_id" + t.integer "job_definition_version" + t.integer "job_instance_id" + t.integer "parent_id" + t.text "script", null: false + t.string "path", limit: 180, default: "/", null: false + t.integer "status", default: 0, null: false + t.text "message", null: false + t.text "context", null: false + t.datetime "created_at" + t.datetime "updated_at" + t.index ["parent_id"], name: "parent_id" + t.index ["status"], name: "status" + end + + create_table "users", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.string "provider", limit: 180, default: "google_oauth2", null: false + t.string "uid", limit: 180, null: false + t.string "name", limit: 180, default: "", null: false + t.string "email", limit: 180, null: false + t.string "first_name", limit: 180, default: "", null: false + t.string "last_name", limit: 180, default: "", null: false + t.string "image", limit: 180, default: "", null: false + t.datetime "suspended_at" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["email"], name: "email" + t.index ["uid", "suspended_at"], name: "uid_2" + t.index ["uid"], name: "uid", unique: true + end + + create_table "workers", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| + t.string "hostname", limit: 180, null: false + t.integer "worker_id", limit: 1, null: false + t.string "queue", limit: 180, default: "@default", null: false + t.boolean "working", default: false, null: false + t.integer "execution_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["hostname", "worker_id"], name: "hostname", unique: true end create_table "logs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "job_instance_id" - t.string "level", limit: 10 - t.text "message", limit: 4294967295 + t.integer "job_instance_id" + t.string "level", limit: 10 + t.text "message", limit: 4294967295 t.datetime "created_at" t.datetime "updated_at" - t.index ["job_instance_id"], name: "job_instance_id", using: :btree + t.index ["job_instance_id"], name: "job_instance_id" end create_table "memory_consumption_logs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "job_instance_id" - t.integer "value", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["job_instance_id"], name: "index_kuroko2_memory_consumption_logs_on_job_instance_id", using: :btree + t.integer "job_instance_id" + t.integer "value", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_instance_id"], name: "index_kuroko2_memory_consumption_logs_on_job_instance_id" end create_table "memory_expectancies", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "expected_value", default: 0, null: false - t.integer "job_definition_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["job_definition_id"], name: "index_kuroko2_memory_expectancies_on_job_definition_id", using: :btree + t.integer "expected_value", default: 0, null: false + t.integer "job_definition_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["job_definition_id"], name: "index_kuroko2_memory_expectancies_on_job_definition_id" end create_table "process_signals", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.string "hostname", limit: 180, default: "", null: false - t.integer "pid", null: false - t.integer "number", limit: 1, default: 15, null: false + t.string "hostname", limit: 180, default: "", null: false + t.integer "pid", null: false + t.integer "number", limit: 1, default: 15, null: false t.datetime "started_at" t.datetime "created_at" t.datetime "updated_at" - t.text "message", limit: 65535 - t.index ["hostname", "started_at"], name: "hostname_started_at", using: :btree + t.text "message" + t.index ["hostname", "started_at"], name: "hostname_started_at" end create_table "stars", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.integer "user_id", null: false - t.integer "job_definition_id", null: false + t.integer "user_id", null: false + t.integer "job_definition_id", null: false t.datetime "created_at" t.datetime "updated_at" - t.index ["user_id", "job_definition_id"], name: "index_kuroko2_stars_on_user_id_and_job_definition_id", unique: true, using: :btree + t.index ["user_id", "job_definition_id"], name: "index_kuroko2_stars_on_user_id_and_job_definition_id", unique: true end create_table "tags", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.string "name", limit: 100, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["name"], name: "index_kuroko2_tags_on_name", unique: true, using: :btree + t.string "name", limit: 100, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_kuroko2_tags_on_name", unique: true end create_table "ticks", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| @@ -155,47 +341,47 @@ end create_table "tokens", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.string "uuid", limit: 36, null: false - t.integer "job_definition_id" - t.integer "job_definition_version" - t.integer "job_instance_id" - t.integer "parent_id" - t.text "script", limit: 65535, null: false - t.string "path", limit: 180, default: "/", null: false - t.integer "status", default: 0, null: false - t.text "message", limit: 65535, null: false - t.text "context", limit: 65535, null: false + t.string "uuid", limit: 36, null: false + t.integer "job_definition_id" + t.integer "job_definition_version" + t.integer "job_instance_id" + t.integer "parent_id" + t.text "script", null: false + t.string "path", limit: 180, default: "/", null: false + t.integer "status", default: 0, null: false + t.text "message", null: false + t.text "context", null: false t.datetime "created_at" t.datetime "updated_at" - t.index ["parent_id"], name: "parent_id", using: :btree - t.index ["status"], name: "status", using: :btree + t.index ["parent_id"], name: "parent_id" + t.index ["status"], name: "status" end create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.string "provider", limit: 180, default: "google_oauth2", null: false - t.string "uid", limit: 180, null: false - t.string "name", limit: 180, default: "", null: false - t.string "email", limit: 180, null: false - t.string "first_name", limit: 180, default: "", null: false - t.string "last_name", limit: 180, default: "", null: false - t.string "image", limit: 180, default: "", null: false + t.string "provider", limit: 180, default: "google_oauth2", null: false + t.string "uid", limit: 180, null: false + t.string "name", limit: 180, default: "", null: false + t.string "email", limit: 180, null: false + t.string "first_name", limit: 180, default: "", null: false + t.string "last_name", limit: 180, default: "", null: false + t.string "image", limit: 180, default: "", null: false t.datetime "suspended_at" t.datetime "created_at" t.datetime "updated_at" - t.index ["email"], name: "email", using: :btree - t.index ["uid", "suspended_at"], name: "uid_2", using: :btree - t.index ["uid"], name: "uid", unique: true, using: :btree + t.index ["email"], name: "email" + t.index ["uid", "suspended_at"], name: "uid_2" + t.index ["uid"], name: "uid", unique: true end create_table "workers", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t| - t.string "hostname", limit: 180, null: false - t.integer "worker_id", limit: 1, null: false - t.string "queue", limit: 180, default: "@default", null: false - t.boolean "working", default: false, null: false - t.integer "execution_id" + t.string "hostname", limit: 180, null: false + t.integer "worker_id", limit: 1, null: false + t.string "queue", limit: 180, default: "@default", null: false + t.boolean "working", default: false, null: false + t.integer "execution_id" t.datetime "created_at" t.datetime "updated_at" - t.index ["hostname", "worker_id"], name: "hostname", unique: true, using: :btree + t.index ["hostname", "worker_id"], name: "hostname", unique: true end end From 3eb2aa3f82a7a6da5ced15ba9427a8ba4e5824ce Mon Sep 17 00:00:00 2001 From: Eisuke Oishi Date: Tue, 9 May 2017 13:43:11 +0900 Subject: [PATCH 4/4] Revert "Add slim to dependency" This reverts commit 1a2dca5386b057241e2afe2cb0230b9394771039. --- kuroko2.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/kuroko2.gemspec b/kuroko2.gemspec index 26bc97e1..b041deaa 100644 --- a/kuroko2.gemspec +++ b/kuroko2.gemspec @@ -26,7 +26,6 @@ Gem::Specification.new do |s| s.add_dependency 'retryable' s.add_dependency 'faraday' s.add_dependency 'sprockets' - s.add_dependency 'slim' s.add_dependency 'slim-rails' s.add_dependency 'sass', '~> 3.4.5' s.add_dependency 'sass-rails'