2017 refactor

This commit is contained in:
Godwin
2017-04-09 11:37:16 -07:00
parent 3d00b70087
commit d1db46ffaf
302 changed files with 7100 additions and 8082 deletions
-16
View File
@@ -1,16 +0,0 @@
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
@@ -1,15 +0,0 @@
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
@@ -1,17 +0,0 @@
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
@@ -1,17 +0,0 @@
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
@@ -1,13 +0,0 @@
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
@@ -1,14 +0,0 @@
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
@@ -1,12 +0,0 @@
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
@@ -1,5 +0,0 @@
class AddCountryToLocation < ActiveRecord::Migration
def change
add_column :locations, :country, :string
end
end
@@ -1,5 +0,0 @@
class AddTerritoryToLocation < ActiveRecord::Migration
def change
add_column :locations, :territory, :string
end
end
@@ -1,5 +0,0 @@
class AddCityToLocation < ActiveRecord::Migration
def change
add_column :locations, :city, :string
end
end
@@ -1,5 +0,0 @@
class AddStreetToLocation < ActiveRecord::Migration
def change
add_column :locations, :street, :string
end
end
@@ -1,5 +0,0 @@
class AddPostalCodeToLocation < ActiveRecord::Migration
def change
add_column :locations, :postal_code, :string
end
end
@@ -1,5 +0,0 @@
class RemoveAddressFromLocation < ActiveRecord::Migration
def change
remove_column :locations, :address, :string
end
end
@@ -1,5 +0,0 @@
class AddIndexToLocation < ActiveRecord::Migration
def change
add_index :locations, [:latitude, :longitude]
end
end
@@ -1,10 +0,0 @@
class CreateConferenceTypes < ActiveRecord::Migration
def change
create_table :conference_types do |t|
t.string :title
t.string :info
t.timestamps
end
end
end
@@ -1,5 +0,0 @@
class AddSlugToConferenceType < ActiveRecord::Migration
def change
add_column :conference_types, :slug, :string
end
end
@@ -1,11 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,13 +0,0 @@
class CreateTranslations < ActiveRecord::Migration
def change
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
end
@@ -1,14 +0,0 @@
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
@@ -1,5 +0,0 @@
class AddValueToVersions < ActiveRecord::Migration
def change
add_column :versions, :value, :string
end
end
@@ -1,5 +0,0 @@
class AddAvatarToUsers < ActiveRecord::Migration
def change
add_column :users, :avatar, :string
end
end
@@ -1,21 +0,0 @@
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
@@ -1,5 +0,0 @@
class RemoveLocationIdFromOrganizations < ActiveRecord::Migration
def change
remove_column :organizations, :location_id, :integer
end
end
@@ -1,8 +0,0 @@
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
@@ -1,5 +0,0 @@
class CreatePrimaryKeyForLocationsOrganizations < ActiveRecord::Migration
def change
add_index :locations_organizations, [:organization_id, :location_id], :name => 'loc_org_index'
end
end
@@ -1,10 +0,0 @@
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
@@ -1,5 +0,0 @@
class AddCoverToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :cover, :string
end
end
@@ -1,5 +0,0 @@
class AddIdToOrganizationUserRelationship < ActiveRecord::Migration
def change
#add_column :user_organization_relationships, :id, :integer
end
end
@@ -1,21 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,10 +0,0 @@
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
@@ -1,7 +0,0 @@
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
@@ -1,14 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,5 +0,0 @@
class RenameConferenceRegistratonFormFieldsToConferenceRegistrationFormFields < ActiveRecord::Migration
def change
rename_table :conference_registraton_form_fields, :conference_registration_form_fields
end
end
@@ -1,5 +0,0 @@
class RemoveOrderFromConferenceRegistrationFormFields < ActiveRecord::Migration
def change
remove_column :conference_registration_form_fields, :order, :integer
end
end
@@ -1,5 +0,0 @@
class AddPositionToConferenceRegistrationFormFields < ActiveRecord::Migration
def change
add_column :conference_registration_form_fields, :position, :integer
end
end
@@ -1,18 +0,0 @@
class CreateWorkshops < ActiveRecord::Migration
def change
create_table :workshops do |t|
t.string :title
t.string :slug
t.text :info
t.integer :conference_id
t.integer :workshop_stream_id
t.integer :workshop_presentation_style
t.integer :min_facilitators
t.integer :location_id
t.datetime :start_time
t.datetime :end_time
t.timestamps
end
end
end
@@ -1,11 +0,0 @@
class CreateWorkshopFacilitators < ActiveRecord::Migration
def change
create_table :workshop_facilitators do |t|
t.integer :user_id
t.integer :workshop_id
t.string :role
t.timestamps
end
end
end
@@ -1,11 +0,0 @@
class CreateWorkshopRequestedResources < ActiveRecord::Migration
def change
create_table :workshop_requested_resources do |t|
t.integer :workshop_id
t.integer :workshop_resource_id
t.string :status
t.timestamps
end
end
end
@@ -1,10 +0,0 @@
class CreateEventTypes < ActiveRecord::Migration
def change
create_table :event_types do |t|
t.string :slug
t.text :info
t.timestamps
end
end
end
@@ -1,16 +0,0 @@
class CreateEvents < ActiveRecord::Migration
def change
create_table :events do |t|
t.string :title
t.string :slug
t.integer :event_type_id
t.integer :conference_id
t.text :info
t.integer :location_id
t.datetime :start_time
t.datetime :end_time
t.timestamps
end
end
end
@@ -1,5 +0,0 @@
class AddAboutMeToUsers < ActiveRecord::Migration
def change
add_column :users, :about_me, :text
end
end
@@ -1,5 +0,0 @@
class AddRoleToUsers < ActiveRecord::Migration
def change
add_column :users, :role, :string
end
end
@@ -1,5 +0,0 @@
class AddCoverAttributionIdToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :cover_attribution_id, :integer
end
end
@@ -1,5 +0,0 @@
class AddCoverAttributionNameToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :cover_attribution_name, :string
end
end
@@ -1,5 +0,0 @@
class AddCoverAttributionSrcToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :cover_attribution_src, :string
end
end
@@ -1,5 +0,0 @@
class AddPhoneToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :phone, :string
end
end
@@ -1,5 +0,0 @@
class AddOrganizationStatusIdToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :organization_status_id, :integer
end
end
@@ -1,7 +0,0 @@
class AddCoverAttributionToConferences < ActiveRecord::Migration
def change
add_column :conferences, :cover_attribution_id, :integer
add_column :conferences, :cover_attribution_name, :string
add_column :conferences, :cover_attribution_src, :string
end
end
@@ -1,5 +0,0 @@
class AddCoverAttributionUserIdToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :cover_attribution_user_id, :integer
end
end
@@ -1,5 +0,0 @@
class AddCoverAttributionUserIdToConferences < ActiveRecord::Migration
def change
add_column :conferences, :cover_attribution_user_id, :integer
end
end
@@ -1,5 +0,0 @@
class AddIsConfirmedToConferenceRegistraions < ActiveRecord::Migration
def change
add_column :conference_registrations, :is_confirmed, :boolean
end
end
@@ -1,5 +0,0 @@
class AddIsParticipantToConferenceRegistraions < ActiveRecord::Migration
def change
add_column :conference_registrations, :is_participant, :boolean
end
end
@@ -1,5 +0,0 @@
class AddIsVolunteerToConferenceRegistraions < ActiveRecord::Migration
def change
add_column :conference_registrations, :is_volunteer, :boolean
end
end
@@ -1,5 +0,0 @@
class AddFirstnameToUsers < ActiveRecord::Migration
def change
add_column :users, :firstname, :string
end
end
@@ -1,5 +0,0 @@
class AddLastnameToUsers < ActiveRecord::Migration
def change
add_column :users, :lastname, :string
end
end
@@ -1,12 +0,0 @@
class AddSessionsTable < ActiveRecord::Migration
def change
create_table :sessions do |t|
t.string :session_id, :null => false
t.text :data
t.timestamps
end
add_index :sessions, :session_id, :unique => true
add_index :sessions, :updated_at
end
end
@@ -1,5 +0,0 @@
class AddConfirmationTokenToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :confirmation_token, :string
end
end
@@ -1,5 +0,0 @@
class AddDataToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :data, :binary
end
end
@@ -1,5 +0,0 @@
class AddEmailToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :email, :string
end
end
@@ -1,5 +0,0 @@
class AddIsCompleteToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :complete, :boolean
end
end
@@ -1,5 +0,0 @@
class AddCompletedToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :completed, :boolean
end
end
@@ -1,5 +0,0 @@
class AddPaymentConfirmationTokenToConferenceRegistration < ActiveRecord::Migration
def change
add_column :conference_registrations, :payment_confirmation_token, :string
end
end
@@ -1,5 +0,0 @@
class AddPaymentInfoToConferenceRegistration < ActiveRecord::Migration
def change
add_column :conference_registrations, :payment_info, :string
end
end
@@ -1,5 +0,0 @@
class AddOrderToWorkshopStreams < ActiveRecord::Migration
def change
add_column :workshop_streams, :order, :integer
end
end
@@ -1,5 +0,0 @@
class AddOrderToWorkshopPresentationStyles < ActiveRecord::Migration
def change
add_column :workshop_presentation_styles, :order, :integer
end
end
@@ -1,5 +0,0 @@
class AddRegistrationFeesPaidToConferenceRegistration < ActiveRecord::Migration
def change
add_column :conference_registrations, :registration_fees_paid, :integer
end
end
@@ -1,5 +0,0 @@
class AddLocaleToConference < ActiveRecord::Migration
def change
add_column :conferences, :locale, :string
end
end
@@ -1,26 +0,0 @@
class CreateTranslationTables < ActiveRecord::Migration
def self.up
create_table :translation_records do |t|
t.string :locale
t.integer :translator_id
t.string :key
t.text :value
t.date :created_at
end
create_table :dynamic_translation_records do |t|
t.string :locale
t.integer :translator_id
t.string :model_type
t.integer :model_id
t.string :column
t.text :value
t.date :created_at
end
end
def self.down
drop_table :translation_records
drop_table :dynamic_translation_records
end
end
@@ -1,5 +0,0 @@
class AddEmailAddressToConferences < ActiveRecord::Migration
def change
add_column :conferences, :email_address, :string
end
end
@@ -1,5 +0,0 @@
class AddPaypalEmailAddressToConferences < ActiveRecord::Migration
def change
add_column :conferences, :paypal_email_address, :string
end
end
@@ -1,12 +0,0 @@
class CreateEmailConfirmations < ActiveRecord::Migration
def change
create_table :email_confirmations do |t|
t.string :token
t.integer :user_id
t.datetime :expiry
t.string :url
t.timestamps null: false
end
end
end
@@ -1,5 +0,0 @@
class AddIsTranslatorToUsers < ActiveRecord::Migration
def change
add_column :users, :is_translator, :boolean
end
end
@@ -1,10 +0,0 @@
class AddCityToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :city, :string
add_column :conference_registrations, :arrival, :datetime
add_column :conference_registrations, :departure, :datetime
add_column :conference_registrations, :housing, :string
add_column :conference_registrations, :bike, :string
add_column :conference_registrations, :other, :text
end
end
@@ -1,7 +0,0 @@
class AddPaypalInfoToConferences < ActiveRecord::Migration
def change
add_column :conferences, :paypal_username, :string
add_column :conferences, :paypal_password, :string
add_column :conferences, :paypal_signature, :string
end
end
@@ -1,7 +0,0 @@
class AddInfoToRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :allergies, :string
add_column :conference_registrations, :languages, :string
add_column :conference_registrations, :food, :string
end
end
@@ -1,5 +0,0 @@
class MakeUsernameNotNullable < ActiveRecord::Migration
def change
change_column :users, :username, :string, :null => false
end
end
@@ -1,5 +0,0 @@
class MakeUsernameActuallyNotNullable < ActiveRecord::Migration
def change
change_column :users, :username, :string, :null => true
end
end
@@ -1,22 +0,0 @@
class CreateDelayedJobs < ActiveRecord::Migration
def self.up
create_table :delayed_jobs, force: true do |table|
table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue
table.integer :attempts, default: 0, null: false # Provides for retries, but still fail eventually.
table.text :handler, null: false # YAML-encoded string of the object that will do work
table.text :last_error # reason for last failure (See Note below)
table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
table.datetime :locked_at # Set when a client is working on this object
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
table.string :locked_by # Who is working on this object (if locked)
table.string :queue # The name of the queue this job is in
table.timestamps null: true
end
add_index :delayed_jobs, [:priority, :run_at], name: "delayed_jobs_priority"
end
def self.down
drop_table :delayed_jobs
end
end
@@ -1,9 +0,0 @@
class AddLanguagesToWorkshops < ActiveRecord::Migration
def change
add_column :workshops, :languages, :string
add_column :workshops, :needs, :string
add_column :workshops, :space, :string
add_column :workshops, :theme, :string
add_column :workshops, :host_info, :text
end
end
@@ -1,5 +0,0 @@
class AddNotesToWorkshops < ActiveRecord::Migration
def change
add_column :workshops, :notes, :text
end
end
@@ -1,10 +0,0 @@
class CreateWorkshopInterests < ActiveRecord::Migration
def change
create_table :workshop_interests do |t|
t.integer :workshop_id
t.integer :user_id
t.timestamps null: false
end
end
end
@@ -1,5 +0,0 @@
class AddLocaleToWorkshops < ActiveRecord::Migration
def change
add_column :workshops, :locale, :string
end
end
@@ -1,14 +0,0 @@
class CreateEventLocations < ActiveRecord::Migration
def change
create_table :event_locations do |t|
t.string :title
t.integer :conference_id
t.float :latitude
t.float :longitude
t.string :address
t.string :amenities
t.timestamps null: false
end
end
end
@@ -1,5 +0,0 @@
class AddEventLocationIdToWorkshops < ActiveRecord::Migration
def change
add_column :workshops, :event_location_id, :integer
end
end
@@ -1,5 +0,0 @@
class AddEventLocationIdToEvents < ActiveRecord::Migration
def change
add_column :events, :event_location_id, :integer
end
end
@@ -1,5 +0,0 @@
class AddTypeToEvents < ActiveRecord::Migration
def change
add_column :events, :event_type, :string
end
end
@@ -1,5 +0,0 @@
class AddDayPartsToConferences < ActiveRecord::Migration
def change
add_column :conferences, :day_parts, :string
end
end
@@ -1,5 +0,0 @@
class AddStatusToOrganizations < ActiveRecord::Migration
def change
add_column :organizations, :status, :string
end
end
@@ -1,9 +0,0 @@
class AddRegistrationStatusToConferences < ActiveRecord::Migration
def change
add_column :conferences, :registration_status, :string
Conference.find_each do |conference|
conference.registration_status = conference.registration_open ? :open : :closed
conference.save!
end
end
end
@@ -1,5 +0,0 @@
class AddHighestStepToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :highest_step, :string
end
end
@@ -1,5 +0,0 @@
class AddStepsCompletedToConferenceRegistrations < ActiveRecord::Migration
def change
add_column :conference_registrations, :steps_completed, :json
end
end
@@ -1,5 +0,0 @@
class AddNeedsFacilitatorsToWorkshops < ActiveRecord::Migration
def change
add_column :workshops, :needs_facilitators, :boolean
end
end
@@ -1,5 +0,0 @@
class AddLanguagesToUsers < ActiveRecord::Migration
def change
add_column :users, :languages, :json
end
end

Some files were not shown because too many files have changed in this diff Show More