Files
aperonight/db/migrate/20250823145902_create_events.rb
kbe 1a7fb818df feat: Implement the promoter event creation
- Promoter can now create an event in draft mode
- Place is found based on address and long/lat are automatically
  deducted from it
- Slug is forged using the *slug* npm package instead of custom code
2025-09-10 20:46:31 +02:00

30 lines
926 B
Ruby
Executable File

class CreateEvents < ActiveRecord::Migration[8.0]
def change
create_table :events do |t|
t.string :name, null: false
t.string :slug, null: false
t.string :image, null: true
t.text :description, null: false
t.integer :state, default: 0, null: false
t.string :venue_name, null: false
t.string :venue_address, null: false
t.datetime :start_time
t.datetime :end_time
# Latitude and longitude of the place
t.decimal :latitude, precision: 10, scale: 6, null: false
t.decimal :longitude, precision: 10, scale: 6, null: false
# Only admin or later premium promoters could select this
t.boolean :featured, default: false, null: false
t.references :user, null: false, foreign_key: false
t.timestamps
end
add_index :events, :state
add_index :events, :featured
add_index :events, [ :latitude, :longitude ]
end
end