today_ai_weather/db/migrate/20250208052634_create_subregions.rb

16 lines
400 B
Ruby

class CreateSubregions < ActiveRecord::Migration[8.0]
def change
create_table :subregions do |t|
t.string :name, null: false
t.text :translations
t.references :region, foreign_key: true, null: false
t.boolean :flag, default: true
t.string :wiki_data_id
t.timestamps
end
add_reference :countries, :subregion, foreign_key: true, null: true
end
end