First checkin

This commit is contained in:
Matt Barringer 2013-01-07 09:04:09 +01:00
parent f207e2c8b7
commit 90b30db9e8
260 changed files with 37349 additions and 0 deletions

View file

@ -0,0 +1,49 @@
class DeviseCreateUsers < ActiveRecord::Migration
def up
create_table(:users) do |t|
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at
## Rememberable
t.datetime :remember_created_at
## Trackable
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
## Confirmable
t.string :confirmation_token
t.datetime :confirmed_at
t.datetime :confirmation_sent_at
t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
## Token authenticatable
# t.string :authentication_token
t.timestamps
end
add_index :users, :email, :unique => true
add_index :users, :reset_password_token, :unique => true
add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
# add_index :users, :authentication_token, :unique => true
end
def down
drop_table :users
end
end

View file

@ -0,0 +1,24 @@
class CreateConferencesTable < ActiveRecord::Migration
def up
create_table :conferences do |t|
t.string :guid, :null => false
t.string :title, :null => false
t.string :short_title, :null => false
t.string :social_tag
t.string :contact_email, :null => false
t.string :timezone, :null => false
t.string :html_export_path
t.date :start_date, :null => false
t.date :end_date, :null => false
t.boolean :cfp_open, :default => false
t.boolean :registration_open, :default => false
t.references :venue
t.timestamps
end
end
def down
drop_table :conferences
end
end

View file

@ -0,0 +1,24 @@
class CreatePeopleTable < ActiveRecord::Migration
def up
create_table :people do |t|
t.string :guid, :null => false
t.string :first_name, :default => ""
t.string :last_name, :default => ""
t.string :public_name, :default => ""
t.string :company, :default => ""
t.string :email, :null => false
t.boolean :email_public
t.string :avatar_file_name
t.string :avatar_content_type
t.integer :avatar_file_size
t.datetime :avatar_updated_at
t.text :biography
t.references :user
t.timestamps
end
end
def down
drop_table :people
end
end

View file

@ -0,0 +1,15 @@
class CreateRoomsTable < ActiveRecord::Migration
def up
create_table :rooms do |t|
t.string :guid, :null => false
t.references :conference
t.string :name, :null => false
t.integer :size
t.boolean :public, :default => true
end
end
def down
drop_table :rooms
end
end

View file

@ -0,0 +1,16 @@
class CreateTracksTable < ActiveRecord::Migration
def up
create_table :tracks do |t|
t.string :guid, :null => false
t.references :conference
t.string :name, :null => false
t.text :description
t.string :color, :default => "ffffff"
t.timestamps
end
end
def down
end
end

View file

@ -0,0 +1,31 @@
class CreateEventsTable < ActiveRecord::Migration
def up
create_table :events do |t|
t.string :guid, :null => false
t.references :conference
t.references :event_type
t.string :title, :null => false
t.string :subtitle
t.integer :time_slots
t.string :state, :null => false, :default => "new"
t.string :progress, :null => false, :default => "new"
t.string :language
t.datetime :start_time
t.text :abstract
t.text :description
t.boolean :public, :default => true
t.string :logo_file_name
t.string :logo_content_type
t.integer :logo_file_size
t.datetime :logo_updated_at
t.text :proposal_additional_speakers
t.references :track
t.references :room
t.timestamps
end
end
def down
end
end

View file

@ -0,0 +1,13 @@
class CreateEventTypes < ActiveRecord::Migration
def up
create_table :event_types do |t|
t.references :conference
t.string :title, :null => false
t.integer :length, :default => 30
end
end
def down
drop_table :event_types
end
end

View file

@ -0,0 +1,18 @@
class CreateEventPeopleTable < ActiveRecord::Migration
def self.up
create_table :event_people do |t|
t.references :proposal
t.references :person
t.references :event
t.string :event_role, :null => false, :default => "participant"
t.string :comment
t.timestamps
end
end
def self.down
drop_table :event_people
end
end

View file

@ -0,0 +1,20 @@
class CreateVenueTable < ActiveRecord::Migration
def up
create_table :venues do |t|
t.string :guid
t.string :name
t.string :address
t.string :website
t.text :description
t.string :offline_map_url
t.string :offline_map_bounds
t.timestamps
end
end
def down
drop_table :venues
end
end

View file

@ -0,0 +1,12 @@
class CreateRolesTable < ActiveRecord::Migration
def self.up
create_table :roles do |t|
t.string :name
t.timestamps
end
end
def self.down
drop_table :roles
end
end

View file

@ -0,0 +1,12 @@
class UserRolesTable < ActiveRecord::Migration
def self.up
create_table :roles_users, :id => false do |t|
t.references :role, :user
end
end
def self.down
drop_table :roles_users
end
end

View file

@ -0,0 +1,17 @@
class CreateCfpTable < ActiveRecord::Migration
def up
create_table :call_for_papers do |t|
t.date :start_date, :null => false
t.date :end_date, :null => false
t.date :hard_deadline, :null => false
t.text :description, :null => false
t.references :conference
t.timestamps
end
end
def down
drop_table :call_for_papers
end
end

View file

@ -0,0 +1,19 @@
class CreateRegistrationsTable < ActiveRecord::Migration
def up
create_table :registrations do |t|
t.references :person
t.references :conference
t.boolean :attending_social_events, :default => true
t.boolean :attending_social_events_with_partner, :default => false
t.boolean :using_affiliated_lodging, :default => true
t.date :arrival
t.date :departure
t.timestamps
end
end
def down
end
end

View file

@ -0,0 +1,19 @@
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.string :title, :limit => 50, :default => ""
t.text :comment
t.references :commentable, :polymorphic => true
t.references :user
t.timestamps
end
add_index :comments, :commentable_type
add_index :comments, :commentable_id
add_index :comments, :user_id
end
def self.down
drop_table :comments
end
end

View file

@ -0,0 +1,19 @@
class ActsAsCommentableUpgradeMigration < ActiveRecord::Migration
def self.up
rename_column :comments, :comment, :body
add_column :comments, :subject, :string
add_column :comments, :parent_id, :integer
add_column :comments, :lft, :integer
add_column :comments, :rgt, :integer
end
def self.down
rename_column :comments, :body, :comment
remove_column :comments, :subject
remove_column :comments, :parent_id
remove_column :comments, :lft
remove_column :comments, :rgt
end
end

View file

@ -0,0 +1,18 @@
class CreateEventAttachmentsTable < ActiveRecord::Migration
def up
create_table :event_attachments do |t|
t.references :event
t.string :title, :null => false
t.string :attachment_file_name
t.string :attachment_content_type
t.integer :attachment_file_size
t.datetime :attachment_updated_at
t.boolean :public, :default => true
t.timestamps
end
end
def down
drop_table :event_attachments
end
end

208
db/schema.rb Normal file
View file

@ -0,0 +1,208 @@
# 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 => 20130105115603) do
create_table "call_for_papers", :force => true do |t|
t.date "start_date", :null => false
t.date "end_date", :null => false
t.date "hard_deadline", :null => false
t.text "description", :null => false
t.integer "conference_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "comments", :force => true do |t|
t.string "title", :limit => 50, :default => ""
t.text "body"
t.integer "commentable_id"
t.string "commentable_type"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "subject"
t.integer "parent_id"
t.integer "lft"
t.integer "rgt"
end
add_index "comments", ["commentable_id"], :name => "index_comments_on_commentable_id"
add_index "comments", ["commentable_type"], :name => "index_comments_on_commentable_type"
add_index "comments", ["user_id"], :name => "index_comments_on_user_id"
create_table "conferences", :force => true do |t|
t.string "guid", :null => false
t.string "title", :null => false
t.string "short_title", :null => false
t.string "social_tag"
t.string "contact_email", :null => false
t.string "timezone", :null => false
t.string "html_export_path"
t.date "start_date", :null => false
t.date "end_date", :null => false
t.boolean "cfp_open", :default => false
t.boolean "registration_open", :default => false
t.integer "venue_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "event_attachments", :force => true do |t|
t.integer "event_id"
t.string "title", :null => false
t.string "attachment_file_name"
t.string "attachment_content_type"
t.integer "attachment_file_size"
t.datetime "attachment_updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "event_people", :force => true do |t|
t.integer "proposal_id"
t.integer "person_id"
t.integer "event_id"
t.string "event_role", :default => "participant", :null => false
t.string "comment"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "event_types", :force => true do |t|
t.integer "conference_id"
t.string "title", :null => false
t.integer "length", :default => 30
end
create_table "events", :force => true do |t|
t.string "guid", :null => false
t.integer "conference_id"
t.integer "event_type_id"
t.string "title", :null => false
t.string "subtitle"
t.integer "time_slots"
t.string "state", :default => "new", :null => false
t.string "progress", :default => "new", :null => false
t.string "language"
t.datetime "start_time"
t.text "abstract"
t.text "description"
t.boolean "public", :default => true
t.string "logo_file_name"
t.string "logo_content_type"
t.integer "logo_file_size"
t.datetime "logo_updated_at"
t.integer "track_id"
t.integer "room_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "proposal_additional_speakers"
end
create_table "people", :force => true do |t|
t.string "guid", :null => false
t.string "first_name", :default => ""
t.string "last_name", :default => ""
t.string "public_name", :default => ""
t.string "company", :default => ""
t.string "email", :null => false
t.boolean "email_public"
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
t.text "biography"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "registrations", :force => true do |t|
t.integer "person_id"
t.integer "conference_id"
t.boolean "attending_social_events", :default => true
t.boolean "attending_social_events_with_partner", :default => false
t.boolean "using_affiliated_lodging", :default => true
t.date "arrival"
t.date "departure"
t.text "additional_speakers"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "roles", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "roles_users", :id => false, :force => true do |t|
t.integer "role_id"
t.integer "user_id"
end
create_table "rooms", :force => true do |t|
t.string "guid", :null => false
t.integer "conference_id"
t.string "name", :null => false
t.integer "size"
t.boolean "public", :default => true
end
create_table "tracks", :force => true do |t|
t.string "guid", :null => false
t.integer "conference_id"
t.string "name", :null => false
t.text "description"
t.string "color", :default => "ffffff"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "users", :force => true do |t|
t.string "email", :default => "", :null => false
t.string "encrypted_password", :default => "", :null => false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
create_table "venues", :force => true do |t|
t.string "guid"
t.string "name"
t.string "address"
t.string "website"
t.text "description"
t.string "offline_map_url"
t.string "offline_map_bounds"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
end

10
db/seeds.rb Normal file
View file

@ -0,0 +1,10 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
Role.create(:name => "Participant")
Role.create(:name => "Organizer")
Role.create(:name => "Admin")