The working basics

This commit is contained in:
Godwin
2014-03-09 14:43:33 -06:00
parent b490a97852
commit db60933506
628 changed files with 81918 additions and 1060 deletions
+16
View File
@@ -0,0 +1,16 @@
class SorceryCore < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :username, :null => false # if you use another field as a username, for example email, you can safely remove this field.
t.string :email, :default => nil # if you use this field as a username, you might want to make it :null => false.
t.string :crypted_password, :default => nil
t.string :salt, :default => nil
t.timestamps
end
end
def self.down
drop_table :users
end
end
@@ -0,0 +1,15 @@
class SorceryRememberMe < ActiveRecord::Migration
def self.up
add_column :users, :remember_me_token, :string, :default => nil
add_column :users, :remember_me_token_expires_at, :datetime, :default => nil
add_index :users, :remember_me_token
end
def self.down
remove_index :users, :remember_me_token
remove_column :users, :remember_me_token_expires_at
remove_column :users, :remember_me_token
end
end
@@ -0,0 +1,17 @@
class SorceryResetPassword < ActiveRecord::Migration
def self.up
add_column :users, :reset_password_token, :string, :default => nil
add_column :users, :reset_password_token_expires_at, :datetime, :default => nil
add_column :users, :reset_password_email_sent_at, :datetime, :default => nil
add_index :users, :reset_password_token
end
def self.down
remove_index :users, :reset_password_token
remove_column :users, :reset_password_email_sent_at
remove_column :users, :reset_password_token_expires_at
remove_column :users, :reset_password_token
end
end
@@ -0,0 +1,17 @@
class SorceryUserActivation < ActiveRecord::Migration
def self.up
add_column :users, :activation_state, :string, :default => nil
add_column :users, :activation_token, :string, :default => nil
add_column :users, :activation_token_expires_at, :datetime, :default => nil
add_index :users, :activation_token
end
def self.down
remove_index :users, :activation_token
remove_column :users, :activation_token_expires_at
remove_column :users, :activation_token
remove_column :users, :activation_state
end
end
@@ -0,0 +1,13 @@
class SorceryBruteForceProtection < ActiveRecord::Migration
def self.up
add_column :users, :failed_logins_count, :integer, :default => 0
add_column :users, :lock_expires_at, :datetime, :default => nil
add_column :users, :unlock_token, :string, :default => nil
end
def self.down
remove_column :users, :lock_expires_at
remove_column :users, :failed_logins_count
remove_column :users, :unlock_token
end
end
@@ -0,0 +1,14 @@
class SorceryExternal < ActiveRecord::Migration
def self.up
create_table :authentications do |t|
t.integer :user_id, :null => false
t.string :provider, :uid, :null => false
t.timestamps
end
end
def self.down
drop_table :authentications
end
end
@@ -0,0 +1,12 @@
class CreateLocations < ActiveRecord::Migration
def change
create_table :locations do |t|
t.string :title
t.string :address
t.float :latitude
t.float :longitude
t.timestamps
end
end
end
@@ -0,0 +1,5 @@
class AddCountryToLocation < ActiveRecord::Migration
def change
add_column :locations, :country, :string
end
end
@@ -0,0 +1,5 @@
class AddTerritoryToLocation < ActiveRecord::Migration
def change
add_column :locations, :territory, :string
end
end
@@ -0,0 +1,5 @@
class AddCityToLocation < ActiveRecord::Migration
def change
add_column :locations, :city, :string
end
end
@@ -0,0 +1,5 @@
class AddStreetToLocation < ActiveRecord::Migration
def change
add_column :locations, :street, :string
end
end
@@ -0,0 +1,5 @@
class AddPostalCodeToLocation < ActiveRecord::Migration
def change
add_column :locations, :postal_code, :string
end
end
@@ -0,0 +1,5 @@
class RemoveAddressFromLocation < ActiveRecord::Migration
def change
remove_column :locations, :address, :string
end
end
@@ -0,0 +1,5 @@
class AddIndexToLocation < ActiveRecord::Migration
def change
add_index :locations, [:latitude, :longitude]
end
end
@@ -0,0 +1,10 @@
class CreateConferenceTypes < ActiveRecord::Migration
def change
create_table :conference_types do |t|
t.string :title
t.string :info
t.timestamps
end
end
end
@@ -0,0 +1,5 @@
class AddSlugToConferenceType < ActiveRecord::Migration
def change
add_column :conference_types, :slug, :string
end
end
@@ -0,0 +1,11 @@
class CreateWorkshopPresentationStyles < ActiveRecord::Migration
def change
create_table :workshop_presentation_styles do |t|
t.string :name
t.string :slug
t.string :info
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateWorkshopResources < ActiveRecord::Migration
def change
create_table :workshop_resources do |t|
t.string :name
t.string :slug
t.string :info
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateWorkshopStreams < ActiveRecord::Migration
def change
create_table :workshop_streams do |t|
t.string :name
t.string :slug
t.string :info
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateOrganizationStatuses < ActiveRecord::Migration
def change
create_table :organization_statuses do |t|
t.string :name
t.string :slug
t.string :info
t.timestamps
end
end
end
@@ -0,0 +1,17 @@
class CreateTranslations < ActiveRecord::Migration
def self.up
create_table :translations do |t|
t.string :locale
t.string :key
t.text :value
t.text :interpolations
t.boolean :is_proc, :default => false
t.timestamps
end
end
def self.down
drop_table :translations
end
end
@@ -0,0 +1,14 @@
class CreateVersions < ActiveRecord::Migration
def change
create_table :versions do |t|
t.string :item_type
t.integer :item_id
t.string :event
t.string :whodunnit
t.text :object
t.datetime :created_at
# t.timestamps
end
end
end
@@ -0,0 +1,5 @@
class AddValueToVersions < ActiveRecord::Migration
def change
add_column :versions, :value, :string
end
end
@@ -0,0 +1,5 @@
class AddAvatarToUsers < ActiveRecord::Migration
def change
add_column :users, :avatar, :string
end
end
@@ -0,0 +1,21 @@
class CreateOrganizations < ActiveRecord::Migration
def change
create_table :organizations do |t|
t.string :name
t.string :slug
t.string :email_address
t.string :url
t.integer :year_founded
t.text :info
t.string :logo
t.string :avatar
t.boolean :requires_approval
t.string :secret_question
t.string :secret_answer
t.integer :location_id
t.integer :user_organization_replationship_id
t.timestamps
end
end
end
@@ -0,0 +1,5 @@
class RemoveLocationIdFromOrganizations < ActiveRecord::Migration
def change
remove_column :organizations, :location_id, :integer
end
end
@@ -0,0 +1,8 @@
class CreateOrganizationLocations < ActiveRecord::Migration
def change
create_table :locations_organizations, :id => false do |t|
t.integer :organization_id
t.integer :location_id
end
end
end
@@ -0,0 +1,5 @@
class CreatePrimaryKeyForLocationsOrganizations < ActiveRecord::Migration
def change
add_index :locations_organizations, [:organization_id, :location_id], :name => 'loc_org_index'
end
end
@@ -0,0 +1,10 @@
class CreateUserOrganizationRelationships < ActiveRecord::Migration
def change
create_table :user_organization_relationships do |t|
t.integer :user_id
t.integer :organization_id
t.string :relationship
t.timestamps
end
end
end
@@ -0,0 +1,5 @@
class AddCoverToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :cover, :string
end
end
@@ -0,0 +1,5 @@
class AddIdToOrganizationUserRelationship < ActiveRecord::Migration
def change
#add_column :user_organization_relationships, :id, :integer
end
end
@@ -0,0 +1,21 @@
class CreateConferences < ActiveRecord::Migration
def change
create_table :conferences do |t|
t.string :title
t.string :slug
t.datetime :start_date
t.datetime :end_date
t.text :info
t.string :poster
t.string :cover
t.boolean :workshop_schedule_published
t.boolean :registration_open
t.boolean :meals_provided
t.text :meal_info
t.text :travel_info
t.integer :conference_type_id
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateConferenceHostOrganizations < ActiveRecord::Migration
def change
create_table :conference_host_organizations do |t|
t.integer :conference_id
t.integer :organization_id
t.integer :order
t.timestamps
end
end
end
@@ -0,0 +1,10 @@
class CreateConferenceAdmins < ActiveRecord::Migration
def change
create_table :conference_admins do |t|
t.integer :conference_id
t.integer :user_id
t.timestamps
end
end
end
@@ -0,0 +1,7 @@
class AddTextFieldsToConference < ActiveRecord::Migration
def change
add_column :conferences, :preregistration_info, :text
add_column :conferences, :registration_info, :text
add_column :conferences, :postregistration_info, :text
end
end
@@ -0,0 +1,14 @@
class CreateRegistrationFormFields < ActiveRecord::Migration
def change
create_table :registration_form_fields do |t|
t.string :title
t.text :help
t.boolean :required
t.string :field_type
t.string :options
t.boolean :is_retired
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateConferenceRegistratonFormFields < ActiveRecord::Migration
def change
create_table :conference_registraton_form_fields do |t|
t.integer :conference_id
t.integer :registration_form_field_id
t.integer :order
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateConferenceRegistrations < ActiveRecord::Migration
def change
create_table :conference_registrations do |t|
t.integer :conference_id
t.integer :user_id
t.string :is_attending
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateConferenceRegistrationResponses < ActiveRecord::Migration
def change
create_table :conference_registration_responses do |t|
t.integer :conference_registration_id
t.integer :registration_form_field_id
t.text :data
t.timestamps
end
end
end
@@ -0,0 +1,5 @@
class RenameConferenceRegistratonFormFieldsToConferenceRegistrationFormFields < ActiveRecord::Migration
def change
rename_table :conference_registraton_form_fields, :conference_registration_form_fields
end
end
@@ -0,0 +1,5 @@
class RemoveOrderFromConferenceRegistrationFormFields < ActiveRecord::Migration
def change
remove_column :conference_registration_form_fields, :order, :integer
end
end
@@ -0,0 +1,5 @@
class AddPositionToConferenceRegistrationFormFields < ActiveRecord::Migration
def change
add_column :conference_registration_form_fields, :position, :integer
end
end
+216 -1
View File
@@ -11,6 +11,221 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 0) do
ActiveRecord::Schema.define(version: 20140308173325) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "authentications", force: true do |t|
t.integer "user_id", null: false
t.string "provider", null: false
t.string "uid", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_admins", force: true do |t|
t.integer "conference_id"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_host_organizations", force: true do |t|
t.integer "conference_id"
t.integer "organization_id"
t.integer "order"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_registration_form_fields", force: true do |t|
t.integer "conference_id"
t.integer "registration_form_field_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "position"
end
create_table "conference_registration_responses", force: true do |t|
t.integer "conference_registration_id"
t.integer "registration_form_field_id"
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_registrations", force: true do |t|
t.integer "conference_id"
t.integer "user_id"
t.string "is_attending"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "conference_types", force: true do |t|
t.string "title"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
t.string "slug"
end
create_table "conferences", force: true do |t|
t.string "title"
t.string "slug"
t.datetime "start_date"
t.datetime "end_date"
t.text "info"
t.string "poster"
t.string "cover"
t.boolean "workshop_schedule_published"
t.boolean "registration_open"
t.boolean "meals_provided"
t.text "meal_info"
t.text "travel_info"
t.integer "conference_type_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "preregistration_info"
t.text "registration_info"
t.text "postregistration_info"
end
create_table "locations", force: true do |t|
t.string "title"
t.float "latitude"
t.float "longitude"
t.datetime "created_at"
t.datetime "updated_at"
t.string "country"
t.string "territory"
t.string "city"
t.string "street"
t.string "postal_code"
end
add_index "locations", ["latitude", "longitude"], name: "index_locations_on_latitude_and_longitude", using: :btree
create_table "locations_organizations", id: false, force: true do |t|
t.integer "organization_id"
t.integer "location_id"
end
add_index "locations_organizations", ["organization_id", "location_id"], name: "loc_org_index", using: :btree
create_table "organization_statuses", force: true do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "organizations", force: true do |t|
t.string "name"
t.string "slug"
t.string "email_address"
t.string "url"
t.integer "year_founded"
t.text "info"
t.string "logo"
t.string "avatar"
t.boolean "requires_approval"
t.string "secret_question"
t.string "secret_answer"
t.integer "user_organization_replationship_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "cover"
end
create_table "registration_form_fields", force: true do |t|
t.string "title"
t.text "help"
t.boolean "required"
t.string "field_type"
t.string "options"
t.boolean "is_retired"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "translations", force: true do |t|
t.string "locale"
t.string "key"
t.text "value"
t.text "interpolations"
t.boolean "is_proc", default: false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "user_organization_relationships", force: true do |t|
t.integer "user_id", null: false
t.integer "organization_id", null: false
t.string "relationship"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "users", force: true do |t|
t.string "username", null: false
t.string "email"
t.string "crypted_password"
t.string "salt"
t.datetime "created_at"
t.datetime "updated_at"
t.string "remember_me_token"
t.datetime "remember_me_token_expires_at"
t.string "reset_password_token"
t.datetime "reset_password_token_expires_at"
t.datetime "reset_password_email_sent_at"
t.string "activation_state"
t.string "activation_token"
t.datetime "activation_token_expires_at"
t.integer "failed_logins_count", default: 0
t.datetime "lock_expires_at"
t.string "unlock_token"
t.string "avatar"
end
add_index "users", ["activation_token"], name: "index_users_on_activation_token", using: :btree
add_index "users", ["remember_me_token"], name: "index_users_on_remember_me_token", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", using: :btree
create_table "versions", force: true do |t|
t.string "item_type"
t.integer "item_id"
t.string "event"
t.string "whodunnit"
t.text "object"
t.datetime "created_at"
t.text "value"
end
create_table "workshop_presentation_styles", force: true do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_resources", force: true do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "workshop_streams", force: true do |t|
t.string "name"
t.string "slug"
t.string "info"
t.datetime "created_at"
t.datetime "updated_at"
end
end