Skip to content

Instantly share code, notes, and snippets.

@camwest
Created June 11, 2010 14:34
Show Gist options
  • Save camwest/434540 to your computer and use it in GitHub Desktop.
Save camwest/434540 to your computer and use it in GitHub Desktop.
ActiveRecord::Schema.define(:version => 20100527145216) do
create_table "access_rights", :force => true do |t|
t.integer "group_id", :null => false
t.integer "restrictable_id"
t.string "restrictable_type"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "access_rights", ["restrictable_type", "restrictable_id", "group_id"], :name => "access_rights_unique_index", :unique => true
create_table "accounts", :force => true do |t|
t.string "subdomain"
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.boolean "content_provider", :default => false
t.boolean "uses_content_restrictions", :default => false
t.integer "users_count"
end
add_index "accounts", ["subdomain"], :name => "index_accounts_on_subdomain", :unique => true
create_table "accounts_roles", :id => false, :force => true do |t|
t.integer "account_id"
t.integer "role_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "accounts_roles", ["account_id", "role_id"], :name => "index_accounts_roles_on_account_id_and_role_id"
create_table "categories", :force => true do |t|
t.string "name"
t.integer "account_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "approved_count", :default => 0
end
add_index "categories", ["account_id"], :name => "index_categories_on_account_id"
create_table "categorizations", :force => true do |t|
t.integer "categorizable_id"
t.integer "category_id"
t.string "categorizable_type"
end
add_index "categorizations", ["categorizable_id", "categorizable_type"], :name => "index_categorizations_on_categorizable_id_and_categorizable_type"
add_index "categorizations", ["categorizable_id"], :name => "index_categorizations_on_channel_id"
add_index "categorizations", ["category_id"], :name => "index_categorizations_on_category_id"
create_table "channels", :force => true do |t|
t.string "name"
t.string "description"
t.integer "account_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.integer "episodes_count", :default => 0
end
add_index "channels", ["account_id"], :name => "index_channels_on_account_id"
create_table "completions", :force => true do |t|
t.integer "user_id", :null => false
t.integer "completable_id"
t.string "completable_type"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "completions", ["user_id"], :name => "index_completions_on_user_id"
create_table "courses", :force => true do |t|
t.string "name"
t.integer "account_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "description"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.boolean "approved", :default => false
end
add_index "courses", ["account_id"], :name => "index_courses_on_account_id"
create_table "groups", :force => true do |t|
t.string "name"
t.integer "account_id"
end
add_index "groups", ["account_id"], :name => "index_groups_on_account_id"
create_table "memberships", :force => true do |t|
t.integer "user_id"
t.integer "group_id"
end
add_index "memberships", ["group_id"], :name => "index_memberships_on_group_id"
add_index "memberships", ["user_id"], :name => "index_memberships_on_user_id"
create_table "package_selections", :force => true do |t|
t.integer "selectable_id", :null => false
t.integer "package_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.string "selectable_type"
end
add_index "package_selections", ["selectable_id", "package_id"], :name => "index_package_selections_on_channel_id_and_package_id"
create_table "packages", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.integer "trial_days"
t.string "billing_code"
end
create_table "roles", :force => true do |t|
t.string "name", :limit => 40
t.string "authorizable_type", :limit => 40
t.integer "authorizable_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "roles", ["authorizable_id"], :name => "index_roles_on_authorizable_id"
add_index "roles", ["authorizable_type"], :name => "index_roles_on_authorizable_type"
add_index "roles", ["name", "authorizable_id", "authorizable_type"], :name => "index_roles_on_name_and_authorizable_id_and_authorizable_type", :unique => true
add_index "roles", ["name"], :name => "index_roles_on_name"
create_table "roles_users", :id => false, :force => true do |t|
t.integer "user_id"
t.integer "role_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "roles_users", ["role_id"], :name => "index_roles_users_on_role_id"
add_index "roles_users", ["user_id", "role_id"], :name => "index_roles_users_on_user_id_and_role_id", :unique => true
add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
create_table "subscriptions", :force => true do |t|
t.integer "account_id"
t.integer "package_id"
t.boolean "paid", :default => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "trial_resets", :default => 0
t.boolean "owner_notified", :default => false
t.integer "trial_days"
end
add_index "subscriptions", ["account_id"], :name => "index_subscriptions_on_account_id"
add_index "subscriptions", ["package_id"], :name => "index_subscriptions_on_package_id"
create_table "supplement_types", :force => true do |t|
t.string "name"
t.integer "account_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "supplement_types", ["account_id"], :name => "index_supplement_types_on_account_id"
create_table "supplements", :force => true do |t|
t.integer "unit_id"
t.integer "type_id"
t.string "document_file_name"
t.string "document_content_type"
t.integer "document_file_size"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "supplements", ["type_id"], :name => "index_supplements_on_type_id"
add_index "supplements", ["unit_id"], :name => "index_supplements_on_unit_id"
create_table "units", :force => true do |t|
t.string "name"
t.integer "course_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "position"
end
add_index "units", ["course_id", "position"], :name => "index_units_on_course_id_and_position"
add_index "units", ["course_id"], :name => "index_units_on_course_id"
create_table "users", :force => true do |t|
t.string "email", :null => false
t.string "crypted_password", :null => false
t.string "password_salt", :null => false
t.string "persistence_token", :null => false
t.string "single_access_token", :null => false
t.string "perishable_token", :null => false
t.integer "login_count", :default => 0, :null => false
t.integer "failed_login_count", :default => 0, :null => false
t.datetime "last_request_at"
t.datetime "current_login_at"
t.datetime "last_login_at"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "account_id"
t.string "name"
end
add_index "users", ["account_id"], :name => "index_users_on_account_id"
create_table "viewables", :force => true do |t|
t.string "name", :limit => 65
t.integer "parent_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "video_file_name"
t.string "video_content_type"
t.integer "video_file_size"
t.boolean "approved", :default => false
t.datetime "approved_at"
t.float "rating", :default => 0.0
t.string "type"
t.string "parent_type"
t.integer "position"
t.integer "encoding_id"
t.boolean "encoded", :default => false
end
add_index "viewables", ["parent_id", "approved"], :name => "by_approved"
add_index "viewables", ["parent_id"], :name => "index_episodes_on_channel_id"
create_table "viewings", :force => true do |t|
t.integer "user_id", :null => false
t.integer "viewable_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "recommended", :default => false
t.boolean "relearning"
end
add_index "viewings", ["relearning"], :name => "index_viewings_on_relearning"
add_index "viewings", ["user_id", "created_at"], :name => "index_viewings_on_user_id_and_created_at"
add_index "viewings", ["viewable_id", "recommended"], :name => "by_episode_and_recommended"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment