select-your-own-seat

Expand History Expand History
Collapse History Collapse History

Add Database Models

This commit adds the following models by running their corresponding generators:

  • Venue: represents the building
  rails generate model Venue name:string slug:string:index
  • Floor: represents a floor within a building
  rails generate model Floor \
    name:string \
    slug:string:index \
    venue:references
  rails generate model Section \
    name:string \
    slug:string:index \
    floor:references \
    price:integer
  • Seat: represents a seat in a Section, along with its x,y coordinates for rendering it
  rails generate model Seat \
    section:references \
    row:string:index \
    number:string:index \
    x:integer \
    y:integer

After running the generators, but before migrating, ensure that each column has null: false passed as an argument to ensure each is declared with a NOT NULL constraint.