Add 'tags' to event model. Add a dataimport system - currently for MaxMind zip files

This commit is contained in:
Dan Milne
2025-11-11 10:31:36 +11:00
parent 772fae7e8b
commit 26216da9ca
34 changed files with 3580 additions and 14 deletions

View File

@@ -0,0 +1,21 @@
class CreateDataImports < ActiveRecord::Migration[8.1]
def change
create_table :data_imports do |t|
t.string :import_type, null: false, comment: "ASN or Country import"
t.string :status, null: false, default: "pending", comment: "pending, processing, completed, failed"
t.string :filename, null: false
t.integer :total_records, default: 0
t.integer :processed_records, default: 0
t.integer :failed_records, default: 0
t.text :error_message
t.json :import_stats, default: {}, comment: "Detailed import statistics"
t.datetime :started_at
t.datetime :completed_at
t.timestamps
end
add_index :data_imports, :status
add_index :data_imports, :import_type
add_index :data_imports, :created_at
end
end