today_ai_weather/db/migrate/20250117095400_create_weather_arts.rb
songtianlun 8e8c60254f feat: add cities feature with weather arts
- Implement CitiesController for listing and showing cities
- Create City and WeatherArt models with associations
- Add views for cities index and show, displaying weather arts
- Include routes for cities and active storage for images
- Update migrations for weather arts and seed data for testing

This commit introduces a comprehensive cities feature that allows users to view cities along with their associated weather art. The implementation includes necessary database migrations, routes, and controller actions to support this new functionality.
2025-01-18 21:42:31 +08:00

22 lines
541 B
Ruby

class CreateWeatherArts < ActiveRecord::Migration[8.0]
def change
create_table :weather_arts do |t|
t.references :city, null: false, foreign_key: true
t.date :weather_date, null: false
t.string :description
t.integer :temperature
t.integer :feeling_temp
t.integer :humidity
t.integer :wind_scale
t.integer :wind_speed
t.decimal :precipitation
t.integer :pressure
t.integer :visibility
t.integer :cloud
t.string :prompt
t.timestamps
end
end
end