today_ai_weather/db/migrate/20250121015841_create_countries.rb
songtianlun ebaf7a3f34 feat: add countries and regions management
- Implement Country and Region models
- Establish relationships between City, Country, and Region
- Update ActiveAdmin setup for managing countries and regions
- Add localization support for cities and countries in multiple languages
- Create necessary migrations to support the new schema

This update allows for better categorization of cities under their respective countries and regions, enhancing geographical structure and support for multilingual features.
2025-01-21 18:27:26 +08:00

15 lines
353 B
Ruby

class CreateCountries < ActiveRecord::Migration[8.0]
def change
create_table :countries do |t|
t.string :name
t.string :code
t.string :slug
t.references :region, null: false, foreign_key: true
t.timestamps
end
add_index :countries, :code, unique: true
add_index :countries, :slug, unique: true
end
end