First commit!
This commit is contained in:
11
db/cable_schema.rb
Normal file
11
db/cable_schema.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
ActiveRecord::Schema[7.1].define(version: 1) do
|
||||
create_table "solid_cable_messages", force: :cascade do |t|
|
||||
t.binary "channel", limit: 1024, null: false
|
||||
t.binary "payload", limit: 536870912, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "channel_hash", limit: 8, null: false
|
||||
t.index ["channel"], name: "index_solid_cable_messages_on_channel"
|
||||
t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash"
|
||||
t.index ["created_at"], name: "index_solid_cable_messages_on_created_at"
|
||||
end
|
||||
end
|
||||
14
db/cache_schema.rb
Normal file
14
db/cache_schema.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 1) do
|
||||
create_table "solid_cache_entries", force: :cascade do |t|
|
||||
t.binary "key", limit: 1024, null: false
|
||||
t.binary "value", limit: 536870912, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "key_hash", limit: 8, null: false
|
||||
t.integer "byte_size", limit: 4, null: false
|
||||
t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size"
|
||||
t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size"
|
||||
t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true
|
||||
end
|
||||
end
|
||||
30
db/migrate/20251102030111_create_network_ranges.rb
Normal file
30
db/migrate/20251102030111_create_network_ranges.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
class CreateNetworkRanges < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :network_ranges do |t|
|
||||
t.binary :ip_address, null: false
|
||||
t.integer :network_prefix, null: false
|
||||
t.integer :ip_version, null: false
|
||||
t.string :company
|
||||
t.integer :asn
|
||||
t.string :asn_org
|
||||
t.boolean :is_datacenter, default: false
|
||||
t.boolean :is_proxy, default: false
|
||||
t.boolean :is_vpn, default: false
|
||||
t.string :ip_api_country
|
||||
t.string :geo2_country
|
||||
t.text :abuser_scores
|
||||
t.text :additional_data
|
||||
t.timestamp :last_api_fetch
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
# Indexes for common queries
|
||||
add_index :network_ranges, [:ip_address, :network_prefix], name: 'idx_network_ranges_ip_range'
|
||||
add_index :network_ranges, :asn, name: 'idx_network_ranges_asn'
|
||||
add_index :network_ranges, :company, name: 'idx_network_ranges_company'
|
||||
add_index :network_ranges, :ip_api_country, name: 'idx_network_ranges_country'
|
||||
add_index :network_ranges, [:is_datacenter, :is_proxy, :is_vpn], name: 'idx_network_ranges_flags'
|
||||
add_index :network_ranges, :ip_version, name: 'idx_network_ranges_version'
|
||||
end
|
||||
end
|
||||
21
db/migrate/20251102044000_create_projects.rb
Normal file
21
db/migrate/20251102044000_create_projects.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class CreateProjects < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :projects do |t|
|
||||
t.string :name, null: false
|
||||
t.string :slug, null: false
|
||||
t.string :public_key, null: false
|
||||
t.boolean :enabled, default: true, null: false
|
||||
t.integer :rate_limit_threshold, default: 100, null: false
|
||||
t.integer :blocked_ip_count, default: 0, null: false
|
||||
t.text :custom_rules, default: "{}", null: false
|
||||
t.text :settings, default: "{}", null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :projects, :slug, unique: true
|
||||
add_index :projects, :public_key, unique: true
|
||||
add_index :projects, :enabled
|
||||
add_index :projects, :name
|
||||
end
|
||||
end
|
||||
37
db/migrate/20251102044052_create_events.rb
Normal file
37
db/migrate/20251102044052_create_events.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
class CreateEvents < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :events do |t|
|
||||
t.references :project, null: false, foreign_key: true
|
||||
t.string :event_id, null: false
|
||||
t.datetime :timestamp, null: false
|
||||
t.string :action
|
||||
t.string :ip_address
|
||||
t.text :user_agent
|
||||
t.string :request_method
|
||||
t.string :request_path
|
||||
t.string :request_url
|
||||
t.string :request_protocol
|
||||
t.integer :response_status
|
||||
t.integer :response_time_ms
|
||||
t.string :rule_matched
|
||||
t.text :blocked_reason
|
||||
t.string :server_name
|
||||
t.string :environment
|
||||
t.string :country_code
|
||||
t.string :city
|
||||
t.string :agent_version
|
||||
t.string :agent_name
|
||||
t.json :payload
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :events, :event_id, unique: true
|
||||
add_index :events, :timestamp
|
||||
add_index :events, [:project_id, :timestamp]
|
||||
add_index :events, [:project_id, :action]
|
||||
add_index :events, [:project_id, :ip_address]
|
||||
add_index :events, :ip_address
|
||||
add_index :events, :action
|
||||
end
|
||||
end
|
||||
13
db/migrate/20251102080959_create_rule_sets.rb
Normal file
13
db/migrate/20251102080959_create_rule_sets.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateRuleSets < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :rule_sets do |t|
|
||||
t.string :name
|
||||
t.text :description
|
||||
t.boolean :enabled
|
||||
t.json :projects
|
||||
t.json :rules
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
17
db/migrate/20251102081014_create_rules.rb
Normal file
17
db/migrate/20251102081014_create_rules.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class CreateRules < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :rules do |t|
|
||||
t.references :rule_set, null: false, foreign_key: true
|
||||
t.string :rule_type
|
||||
t.string :target
|
||||
t.string :action
|
||||
t.boolean :enabled
|
||||
t.datetime :expires_at
|
||||
t.integer :priority
|
||||
t.json :conditions
|
||||
t.json :metadata
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20251102081043_add_fields_to_rule_sets.rb
Normal file
11
db/migrate/20251102081043_add_fields_to_rule_sets.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddFieldsToRuleSets < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
add_column :rule_sets, :slug, :string
|
||||
add_column :rule_sets, :priority, :integer
|
||||
add_column :rule_sets, :projects_subscription, :json
|
||||
|
||||
add_index :rule_sets, :slug, unique: true
|
||||
add_index :rule_sets, :enabled
|
||||
add_index :rule_sets, :priority
|
||||
end
|
||||
end
|
||||
15
db/migrate/20251102234055_add_simple_event_normalization.rb
Normal file
15
db/migrate/20251102234055_add_simple_event_normalization.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class AddSimpleEventNormalization < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
# Add foreign key for hosts (most valuable normalization)
|
||||
add_column :events, :request_host_id, :integer
|
||||
add_foreign_key :events, :request_hosts
|
||||
add_index :events, :request_host_id
|
||||
|
||||
# Add path segment storage as string for LIKE queries
|
||||
add_column :events, :request_segment_ids, :string
|
||||
add_index :events, :request_segment_ids
|
||||
|
||||
# Add composite index for common WAF queries using enums
|
||||
add_index :events, [:request_host_id, :request_method, :request_segment_ids], name: 'idx_events_host_method_path'
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class RenameActionToWafActionInEvents < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
rename_column :events, :action, :waf_action
|
||||
end
|
||||
end
|
||||
129
db/queue_schema.rb
Normal file
129
db/queue_schema.rb
Normal file
@@ -0,0 +1,129 @@
|
||||
ActiveRecord::Schema[7.1].define(version: 1) do
|
||||
create_table "solid_queue_blocked_executions", force: :cascade do |t|
|
||||
t.bigint "job_id", null: false
|
||||
t.string "queue_name", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "concurrency_key", null: false
|
||||
t.datetime "expires_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.index [ "concurrency_key", "priority", "job_id" ], name: "index_solid_queue_blocked_executions_for_release"
|
||||
t.index [ "expires_at", "concurrency_key" ], name: "index_solid_queue_blocked_executions_for_maintenance"
|
||||
t.index [ "job_id" ], name: "index_solid_queue_blocked_executions_on_job_id", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_claimed_executions", force: :cascade do |t|
|
||||
t.bigint "job_id", null: false
|
||||
t.bigint "process_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.index [ "job_id" ], name: "index_solid_queue_claimed_executions_on_job_id", unique: true
|
||||
t.index [ "process_id", "job_id" ], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id"
|
||||
end
|
||||
|
||||
create_table "solid_queue_failed_executions", force: :cascade do |t|
|
||||
t.bigint "job_id", null: false
|
||||
t.text "error"
|
||||
t.datetime "created_at", null: false
|
||||
t.index [ "job_id" ], name: "index_solid_queue_failed_executions_on_job_id", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_jobs", force: :cascade do |t|
|
||||
t.string "queue_name", null: false
|
||||
t.string "class_name", null: false
|
||||
t.text "arguments"
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "active_job_id"
|
||||
t.datetime "scheduled_at"
|
||||
t.datetime "finished_at"
|
||||
t.string "concurrency_key"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index [ "active_job_id" ], name: "index_solid_queue_jobs_on_active_job_id"
|
||||
t.index [ "class_name" ], name: "index_solid_queue_jobs_on_class_name"
|
||||
t.index [ "finished_at" ], name: "index_solid_queue_jobs_on_finished_at"
|
||||
t.index [ "queue_name", "finished_at" ], name: "index_solid_queue_jobs_for_filtering"
|
||||
t.index [ "scheduled_at", "finished_at" ], name: "index_solid_queue_jobs_for_alerting"
|
||||
end
|
||||
|
||||
create_table "solid_queue_pauses", force: :cascade do |t|
|
||||
t.string "queue_name", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.index [ "queue_name" ], name: "index_solid_queue_pauses_on_queue_name", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_processes", force: :cascade do |t|
|
||||
t.string "kind", null: false
|
||||
t.datetime "last_heartbeat_at", null: false
|
||||
t.bigint "supervisor_id"
|
||||
t.integer "pid", null: false
|
||||
t.string "hostname"
|
||||
t.text "metadata"
|
||||
t.datetime "created_at", null: false
|
||||
t.string "name", null: false
|
||||
t.index [ "last_heartbeat_at" ], name: "index_solid_queue_processes_on_last_heartbeat_at"
|
||||
t.index [ "name", "supervisor_id" ], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true
|
||||
t.index [ "supervisor_id" ], name: "index_solid_queue_processes_on_supervisor_id"
|
||||
end
|
||||
|
||||
create_table "solid_queue_ready_executions", force: :cascade do |t|
|
||||
t.bigint "job_id", null: false
|
||||
t.string "queue_name", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.index [ "job_id" ], name: "index_solid_queue_ready_executions_on_job_id", unique: true
|
||||
t.index [ "priority", "job_id" ], name: "index_solid_queue_poll_all"
|
||||
t.index [ "queue_name", "priority", "job_id" ], name: "index_solid_queue_poll_by_queue"
|
||||
end
|
||||
|
||||
create_table "solid_queue_recurring_executions", force: :cascade do |t|
|
||||
t.bigint "job_id", null: false
|
||||
t.string "task_key", null: false
|
||||
t.datetime "run_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.index [ "job_id" ], name: "index_solid_queue_recurring_executions_on_job_id", unique: true
|
||||
t.index [ "task_key", "run_at" ], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_recurring_tasks", force: :cascade do |t|
|
||||
t.string "key", null: false
|
||||
t.string "schedule", null: false
|
||||
t.string "command", limit: 2048
|
||||
t.string "class_name"
|
||||
t.text "arguments"
|
||||
t.string "queue_name"
|
||||
t.integer "priority", default: 0
|
||||
t.boolean "static", default: true, null: false
|
||||
t.text "description"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index [ "key" ], name: "index_solid_queue_recurring_tasks_on_key", unique: true
|
||||
t.index [ "static" ], name: "index_solid_queue_recurring_tasks_on_static"
|
||||
end
|
||||
|
||||
create_table "solid_queue_scheduled_executions", force: :cascade do |t|
|
||||
t.bigint "job_id", null: false
|
||||
t.string "queue_name", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.datetime "scheduled_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.index [ "job_id" ], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true
|
||||
t.index [ "scheduled_at", "priority", "job_id" ], name: "index_solid_queue_dispatch_all"
|
||||
end
|
||||
|
||||
create_table "solid_queue_semaphores", force: :cascade do |t|
|
||||
t.string "key", null: false
|
||||
t.integer "value", default: 1, null: false
|
||||
t.datetime "expires_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index [ "expires_at" ], name: "index_solid_queue_semaphores_on_expires_at"
|
||||
t.index [ "key", "value" ], name: "index_solid_queue_semaphores_on_key_and_value"
|
||||
t.index [ "key" ], name: "index_solid_queue_semaphores_on_key", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
end
|
||||
161
db/schema.rb
Normal file
161
db/schema.rb
Normal file
@@ -0,0 +1,161 @@
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
||||
# be faster and is potentially less error prone than running all of your
|
||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
||||
# migrations use external dependencies or application code.
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2025_11_03_035249) do
|
||||
create_table "events", force: :cascade do |t|
|
||||
t.string "agent_name"
|
||||
t.string "agent_version"
|
||||
t.text "blocked_reason"
|
||||
t.string "city"
|
||||
t.string "country_code"
|
||||
t.datetime "created_at", null: false
|
||||
t.string "environment"
|
||||
t.string "event_id", null: false
|
||||
t.string "ip_address"
|
||||
t.json "payload"
|
||||
t.integer "project_id", null: false
|
||||
t.integer "request_host_id"
|
||||
t.string "request_method"
|
||||
t.string "request_path"
|
||||
t.string "request_protocol"
|
||||
t.string "request_segment_ids"
|
||||
t.string "request_url"
|
||||
t.integer "response_status"
|
||||
t.integer "response_time_ms"
|
||||
t.string "rule_matched"
|
||||
t.string "server_name"
|
||||
t.datetime "timestamp", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.text "user_agent"
|
||||
t.string "waf_action"
|
||||
t.index ["event_id"], name: "index_events_on_event_id", unique: true
|
||||
t.index ["ip_address"], name: "index_events_on_ip_address"
|
||||
t.index ["project_id", "ip_address"], name: "index_events_on_project_id_and_ip_address"
|
||||
t.index ["project_id", "timestamp"], name: "index_events_on_project_id_and_timestamp"
|
||||
t.index ["project_id", "waf_action"], name: "index_events_on_project_id_and_waf_action"
|
||||
t.index ["project_id"], name: "index_events_on_project_id"
|
||||
t.index ["request_host_id", "request_method", "request_segment_ids"], name: "idx_events_host_method_path"
|
||||
t.index ["request_host_id"], name: "index_events_on_request_host_id"
|
||||
t.index ["request_segment_ids"], name: "index_events_on_request_segment_ids"
|
||||
t.index ["timestamp"], name: "index_events_on_timestamp"
|
||||
t.index ["waf_action"], name: "index_events_on_waf_action"
|
||||
end
|
||||
|
||||
create_table "network_ranges", force: :cascade do |t|
|
||||
t.text "abuser_scores"
|
||||
t.text "additional_data"
|
||||
t.integer "asn"
|
||||
t.string "asn_org"
|
||||
t.string "company"
|
||||
t.datetime "created_at", null: false
|
||||
t.string "geo2_country"
|
||||
t.binary "ip_address", null: false
|
||||
t.string "ip_api_country"
|
||||
t.integer "ip_version", null: false
|
||||
t.boolean "is_datacenter", default: false
|
||||
t.boolean "is_proxy", default: false
|
||||
t.boolean "is_vpn", default: false
|
||||
t.datetime "last_api_fetch"
|
||||
t.integer "network_prefix", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["asn"], name: "idx_network_ranges_asn"
|
||||
t.index ["company"], name: "idx_network_ranges_company"
|
||||
t.index ["ip_address", "network_prefix"], name: "idx_network_ranges_ip_range"
|
||||
t.index ["ip_api_country"], name: "idx_network_ranges_country"
|
||||
t.index ["ip_version"], name: "idx_network_ranges_version"
|
||||
t.index ["is_datacenter", "is_proxy", "is_vpn"], name: "idx_network_ranges_flags"
|
||||
end
|
||||
|
||||
create_table "path_segments", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "first_seen_at", null: false
|
||||
t.string "segment", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "usage_count", default: 1, null: false
|
||||
t.index ["segment"], name: "index_path_segments_on_segment", unique: true
|
||||
end
|
||||
|
||||
create_table "projects", force: :cascade do |t|
|
||||
t.integer "blocked_ip_count", default: 0, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.text "custom_rules", default: "{}", null: false
|
||||
t.boolean "enabled", default: true, null: false
|
||||
t.string "name", null: false
|
||||
t.string "public_key", null: false
|
||||
t.integer "rate_limit_threshold", default: 100, null: false
|
||||
t.text "settings", default: "{}", null: false
|
||||
t.string "slug", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["enabled"], name: "index_projects_on_enabled"
|
||||
t.index ["name"], name: "index_projects_on_name"
|
||||
t.index ["public_key"], name: "index_projects_on_public_key", unique: true
|
||||
t.index ["slug"], name: "index_projects_on_slug", unique: true
|
||||
end
|
||||
|
||||
create_table "request_hosts", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "first_seen_at", null: false
|
||||
t.string "hostname", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "usage_count", default: 1, null: false
|
||||
t.index ["hostname"], name: "index_request_hosts_on_hostname", unique: true
|
||||
end
|
||||
|
||||
create_table "request_methods", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "method", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["method"], name: "index_request_methods_on_method", unique: true
|
||||
end
|
||||
|
||||
create_table "request_protocols", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "protocol", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["protocol"], name: "index_request_protocols_on_protocol", unique: true
|
||||
end
|
||||
|
||||
create_table "rule_sets", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.text "description"
|
||||
t.boolean "enabled"
|
||||
t.string "name"
|
||||
t.integer "priority"
|
||||
t.json "projects"
|
||||
t.json "projects_subscription"
|
||||
t.json "rules"
|
||||
t.string "slug"
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["enabled"], name: "index_rule_sets_on_enabled"
|
||||
t.index ["priority"], name: "index_rule_sets_on_priority"
|
||||
t.index ["slug"], name: "index_rule_sets_on_slug", unique: true
|
||||
end
|
||||
|
||||
create_table "rules", force: :cascade do |t|
|
||||
t.string "action"
|
||||
t.json "conditions"
|
||||
t.datetime "created_at", null: false
|
||||
t.boolean "enabled"
|
||||
t.datetime "expires_at"
|
||||
t.json "metadata"
|
||||
t.integer "priority"
|
||||
t.integer "rule_set_id", null: false
|
||||
t.string "rule_type"
|
||||
t.string "target"
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["rule_set_id"], name: "index_rules_on_rule_set_id"
|
||||
end
|
||||
|
||||
add_foreign_key "events", "projects"
|
||||
add_foreign_key "events", "request_hosts"
|
||||
add_foreign_key "rules", "rule_sets"
|
||||
end
|
||||
9
db/seeds.rb
Normal file
9
db/seeds.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
# This file should ensure the existence of records required to run the application in every environment (production,
|
||||
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
|
||||
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
|
||||
# MovieGenre.find_or_create_by!(name: genre_name)
|
||||
# end
|
||||
Reference in New Issue
Block a user