Skip to content

Instantly share code, notes, and snippets.

@jagmitg
Created March 30, 2012 00:10
Show Gist options
  • Save jagmitg/2245132 to your computer and use it in GitHub Desktop.
Save jagmitg/2245132 to your computer and use it in GitHub Desktop.
class Cinema < ActiveRecord::Base
has_many :screenings
has_many :films, :through => :screenings
has_one :location
end
class Film < ActiveRecord::Base
has_many :screenings
end
class Location < ActiveRecord::Base
belongs_to :cinema
end
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20120325212946) do
create_table "cinemas", :force => true do |t|
t.string "name"
t.string "url"
t.string "postcode"
t.string "telephone"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "external_id"
end
create_table "films", :force => true do |t|
t.string "title"
t.string "rating"
t.string "release"
t.string "length"
t.string "poster"
t.string "director"
t.string "synopsis"
t.string "cast"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "locations", :force => true do |t|
t.string "addressing"
t.float "latitude"
t.float "longitude"
t.integer "cinema_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "screening", :force => true do |t|
t.integer "cinema_id"
t.integer "film_id"
end
create_table "screenings", :force => true do |t|
t.integer "cinema_id"
t.integer "film_id"
end
create_table "shows", :force => true do |t|
t.integer "cinema_id"
t.integer "film_id"
t.string "day"
t.string "showed_at"
t.string "video_type"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "screening_id"
end
end
class Screening < ActiveRecord::Base
has_many :shows
belongs_to :cinema
belongs_to :film
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment