Migrate to Postgresql for better network handling. Add more user functionality.
This commit is contained in:
44
db/migrate/004_create_request_optimization_tables.rb
Normal file
44
db/migrate/004_create_request_optimization_tables.rb
Normal file
@@ -0,0 +1,44 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateRequestOptimizationTables < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
# Path segments for compression and analytics
|
||||
create_table :path_segments, force: :cascade do |t|
|
||||
t.string :segment, null: false, index: { unique: true }
|
||||
t.integer :usage_count, default: 1, null: false
|
||||
t.datetime :first_seen_at, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
# Request hosts for compression and analytics
|
||||
create_table :request_hosts, force: :cascade do |t|
|
||||
t.string :hostname, null: false, index: { unique: true }
|
||||
t.integer :usage_count, default: 1, null: false
|
||||
t.datetime :first_seen_at, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
# Request methods for normalization
|
||||
create_table :request_methods, force: :cascade do |t|
|
||||
t.string :method, null: false, index: { unique: true }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
# Request protocols for normalization
|
||||
create_table :request_protocols, force: :cascade do |t|
|
||||
t.string :protocol, null: false, index: { unique: true }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
# Request actions for normalization
|
||||
create_table :request_actions, force: :cascade do |t|
|
||||
t.string :action, null: false, index: { unique: true }
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user