|
|
|
@ -4,13 +4,11 @@ class CreateCsvVariableDefinitions < ActiveRecord::Migration[7.0] |
|
|
|
t.string :variable, null: false |
|
|
|
t.string :variable, null: false |
|
|
|
t.string :definition, null: false |
|
|
|
t.string :definition, null: false |
|
|
|
t.string :log_type, null: false |
|
|
|
t.string :log_type, null: false |
|
|
|
t.string :user_type, null: false |
|
|
|
|
|
|
|
t.integer :year, null: false |
|
|
|
t.integer :year, null: false |
|
|
|
t.datetime :last_accessed |
|
|
|
t.datetime :last_accessed |
|
|
|
t.timestamps |
|
|
|
t.timestamps |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
add_check_constraint :csv_variable_definitions, "user_type IN ('user', 'support')", name: "user_type_check" |
|
|
|
|
|
|
|
add_check_constraint :csv_variable_definitions, "log_type IN ('lettings', 'sales')", name: "log_type_check" |
|
|
|
add_check_constraint :csv_variable_definitions, "log_type IN ('lettings', 'sales')", name: "log_type_check" |
|
|
|
add_check_constraint :csv_variable_definitions, "year BETWEEN 2000 AND 2099", name: "year_check" |
|
|
|
add_check_constraint :csv_variable_definitions, "year BETWEEN 2000 AND 2099", name: "year_check" |
|
|
|
end |
|
|
|
end |
|
|
|
|