From 3465d3154786df7c031f19782829b77e5f984528 Mon Sep 17 00:00:00 2001 From: Christian Flach Date: Mon, 4 Jun 2018 10:18:29 +0200 Subject: [PATCH] Squash all old migrations, default to SQLite (much faster) --- README.md | 9 +- Vagrantfile | 1 + app/models/application_letter.rb | 5 - .../20161101110308_devise_create_users.rb | 42 ------ db/migrate/20161102091145_add_name_to_user.rb | 5 - db/migrate/20161102131604_create_profiles.rb | 10 -- db/migrate/20161103093520_create_workshops.rb | 12 -- .../20161103101916_create_applications.rb | 11 -- db/migrate/20161103103151_create_requests.rb | 10 -- ...ame_applications_to_application_letters.rb | 5 - ...07131407_make_foreign_keys_not_nullable.rb | 10 -- ...61114195923_add_private_data_to_profile.rb | 16 --- .../20161116092838_add_role_to_users.rb | 5 - ...123250_add_status_to_application_letter.rb | 5 - ...20161122144126_create_application_notes.rb | 10 -- ...ional_information_to_application_letter.rb | 12 -- ...20161123124500_change_workshop_to_event.rb | 6 - ...20161125123712_add_date_ranges_to_event.rb | 11 -- ...20161125164958_create_agreement_letters.rb | 11 -- .../20161126113138_add_kind_to_events.rb | 5 - .../20161126190339_add_draft_to_events.rb | 5 - ...161129110700_add_organizer_to_workshops.rb | 10 -- ...111916_add_knowledge_level_to_workshops.rb | 10 -- ...add_default_value_to_application_status.rb | 6 - ...121741_remove_c_vand_email_from_profile.rb | 6 - .../20161129131315_rename_tutor_to_coach.rb | 9 -- ...5355_add_application_deadline_to_events.rb | 5 - ...add_application_status_locked_to_events.rb | 5 - ...20161209180054_remove_active_from_event.rb | 5 - .../20161222154024_remove_name_from_users.rb | 5 - .../20170104135212_add_fields_to_requests.rb | 17 --- .../20170107140419_create_email_templates.rb | 10 -- .../20170108122417_add_status_to_requests.rb | 5 - ...23_add_unlimited_participants_to_events.rb | 5 - ...0170111135212_rename_draft_to_published.rb | 14 -- ..._add_custom_application_fields_to_event.rb | 5 - .../20170114132153_change_address_fields.rb | 6 - ...plication_fields_to_application_letters.rb | 5 - ...8161954_rename_vegeterian_to_vegetarian.rb | 5 - ...19223355_add_contact_person_to_requests.rb | 5 - ...change_request_description_to_textfield.rb | 5 - ...0170122191752_create_participant_groups.rb | 9 -- .../20170123161527_add_hidden_to_event.rb | 5 - .../20170123205418_add_notes_to_requests.rb | 5 - ...8_add_annotation_to_application_letters.rb | 5 - .../20170125201341_add_image_to_events.rb | 5 - ...22851_add_discovery_of_site_to_profiles.rb | 5 - ...170201110130_remove_school_from_profile.rb | 7 - ...ove_experience_from_application_letters.rb | 5 - ...01131446_add_default_value_to_published.rb | 9 -- ...70201132359_add_default_value_to_hidden.rb | 9 -- .../20170201141415_remove_kind_from_events.rb | 5 - ..._participants_are_unlimited_from_events.rb | 5 - ...remove_allergic_from_application_letter.rb | 5 - ...e_application_status_locked_from_events.rb | 5 - ...add_rejections_have_been_sent_to_events.rb | 5 - ...dd_acceptances_have_been_sent_to_events.rb | 5 - ...03150152_remove_fields_from_application.rb | 6 - ...otification_sent_to_application_letters.rb | 5 - ...170207133819_add_custom_image_to_events.rb | 5 - .../20170605080836_add_omniauth_to_users.rb | 6 - db/migrate/20170605080836_init_schema.rb | 134 ++++++++++++++++++ 62 files changed, 136 insertions(+), 463 deletions(-) delete mode 100644 db/migrate/20161101110308_devise_create_users.rb delete mode 100644 db/migrate/20161102091145_add_name_to_user.rb delete mode 100644 db/migrate/20161102131604_create_profiles.rb delete mode 100644 db/migrate/20161103093520_create_workshops.rb delete mode 100644 db/migrate/20161103101916_create_applications.rb delete mode 100644 db/migrate/20161103103151_create_requests.rb delete mode 100644 db/migrate/20161107124714_rename_applications_to_application_letters.rb delete mode 100644 db/migrate/20161107131407_make_foreign_keys_not_nullable.rb delete mode 100644 db/migrate/20161114195923_add_private_data_to_profile.rb delete mode 100644 db/migrate/20161116092838_add_role_to_users.rb delete mode 100644 db/migrate/20161120123250_add_status_to_application_letter.rb delete mode 100644 db/migrate/20161122144126_create_application_notes.rb delete mode 100644 db/migrate/20161122151522_add_additional_information_to_application_letter.rb delete mode 100644 db/migrate/20161123124500_change_workshop_to_event.rb delete mode 100644 db/migrate/20161125123712_add_date_ranges_to_event.rb delete mode 100644 db/migrate/20161125164958_create_agreement_letters.rb delete mode 100644 db/migrate/20161126113138_add_kind_to_events.rb delete mode 100644 db/migrate/20161126190339_add_draft_to_events.rb delete mode 100644 db/migrate/20161129110700_add_organizer_to_workshops.rb delete mode 100644 db/migrate/20161129111916_add_knowledge_level_to_workshops.rb delete mode 100644 db/migrate/20161129120651_add_default_value_to_application_status.rb delete mode 100644 db/migrate/20161129121741_remove_c_vand_email_from_profile.rb delete mode 100644 db/migrate/20161129131315_rename_tutor_to_coach.rb delete mode 100644 db/migrate/20161204205355_add_application_deadline_to_events.rb delete mode 100644 db/migrate/20161207094400_add_application_status_locked_to_events.rb delete mode 100644 db/migrate/20161209180054_remove_active_from_event.rb delete mode 100644 db/migrate/20161222154024_remove_name_from_users.rb delete mode 100644 db/migrate/20170104135212_add_fields_to_requests.rb delete mode 100644 db/migrate/20170107140419_create_email_templates.rb delete mode 100644 db/migrate/20170108122417_add_status_to_requests.rb delete mode 100644 db/migrate/20170110132223_add_unlimited_participants_to_events.rb delete mode 100644 db/migrate/20170111135212_rename_draft_to_published.rb delete mode 100644 db/migrate/20170113083747_add_custom_application_fields_to_event.rb delete mode 100644 db/migrate/20170114132153_change_address_fields.rb delete mode 100644 db/migrate/20170116093536_add_custom_application_fields_to_application_letters.rb delete mode 100644 db/migrate/20170118161954_rename_vegeterian_to_vegetarian.rb delete mode 100644 db/migrate/20170119223355_add_contact_person_to_requests.rb delete mode 100644 db/migrate/20170120183139_change_request_description_to_textfield.rb delete mode 100644 db/migrate/20170122191752_create_participant_groups.rb delete mode 100644 db/migrate/20170123161527_add_hidden_to_event.rb delete mode 100644 db/migrate/20170123205418_add_notes_to_requests.rb delete mode 100644 db/migrate/20170124225558_add_annotation_to_application_letters.rb delete mode 100644 db/migrate/20170125201341_add_image_to_events.rb delete mode 100644 db/migrate/20170128122851_add_discovery_of_site_to_profiles.rb delete mode 100644 db/migrate/20170201110130_remove_school_from_profile.rb delete mode 100644 db/migrate/20170201115658_remove_experience_from_application_letters.rb delete mode 100644 db/migrate/20170201131446_add_default_value_to_published.rb delete mode 100644 db/migrate/20170201132359_add_default_value_to_hidden.rb delete mode 100644 db/migrate/20170201141415_remove_kind_from_events.rb delete mode 100644 db/migrate/20170201150603_remove_participants_are_unlimited_from_events.rb delete mode 100644 db/migrate/20170201154540_remove_allergic_from_application_letter.rb delete mode 100644 db/migrate/20170201201804_remove_application_status_locked_from_events.rb delete mode 100644 db/migrate/20170201201819_add_rejections_have_been_sent_to_events.rb delete mode 100644 db/migrate/20170201201932_add_acceptances_have_been_sent_to_events.rb delete mode 100644 db/migrate/20170203150152_remove_fields_from_application.rb delete mode 100644 db/migrate/20170203180638_add_status_notification_sent_to_application_letters.rb delete mode 100644 db/migrate/20170207133819_add_custom_image_to_events.rb delete mode 100644 db/migrate/20170605080836_add_omniauth_to_users.rb create mode 100644 db/migrate/20170605080836_init_schema.rb diff --git a/README.md b/README.md index 668c7d59..29d37c1a 100644 --- a/README.md +++ b/README.md @@ -45,15 +45,8 @@ Please keep in mind that this method may lead to a loss in performance, due to t ``` vagrant up # bring up the VM vagrant ssh # login using SSH -cd hpi-swt2 -echo "gem: --no-document" >> ~/.gemrc # disable docs for gems bundle install # install dependencies -gem install pg # required for Postgres usage -cp config/database.psql.yml config/database.yml # in case you want to use Postgres -cp config/database.sqlite.yml config/database.yml # in case you want to use SQLite -exit # restart the session, required step -vagrant ssh # reconnect to the VM -cd hpi-swt2 +rbenv rehash # reload newly installed binaries rails s -b 0 # start the rails server # the -b part is necessary since the app is running in a VM and would # otherwise drop the requests coming from the host OS diff --git a/Vagrantfile b/Vagrantfile index fe53fed6..54d5bfdd 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -28,5 +28,6 @@ Vagrant.configure("2") do |config| apt-get install -y phantomjs apt-get install -y imagemagick echo "cd hpi-swt2" >> /home/vagrant/.bashrc + echo "gem: --no-document" >> /home/vagrant/.gemrc # disable docs for gems SHELL end diff --git a/app/models/application_letter.rb b/app/models/application_letter.rb index 22ae43e4..a9ee87d1 100644 --- a/app/models/application_letter.rb +++ b/app/models/application_letter.rb @@ -23,11 +23,6 @@ # index_application_letters_on_event_id (event_id) # index_application_letters_on_user_id (user_id) # -# Foreign Keys -# -# fk_rails_... (event_id => events.id) -# fk_rails_... (user_id => users.id) -# class ApplicationLetter < ActiveRecord::Base belongs_to :user diff --git a/db/migrate/20161101110308_devise_create_users.rb b/db/migrate/20161101110308_devise_create_users.rb deleted file mode 100644 index 0f1df282..00000000 --- a/db/migrate/20161101110308_devise_create_users.rb +++ /dev/null @@ -1,42 +0,0 @@ -class DeviseCreateUsers < ActiveRecord::Migration[4.2] - def change - 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, null: false - 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, null: false # Only if lock strategy is :failed_attempts - # t.string :unlock_token # Only if unlock strategy is :email or :both - # t.datetime :locked_at - - - t.timestamps null: false - 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 - end -end diff --git a/db/migrate/20161102091145_add_name_to_user.rb b/db/migrate/20161102091145_add_name_to_user.rb deleted file mode 100644 index 0cb8f75b..00000000 --- a/db/migrate/20161102091145_add_name_to_user.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNameToUser < ActiveRecord::Migration[4.2] - def change - add_column :users, :name, :string - end -end diff --git a/db/migrate/20161102131604_create_profiles.rb b/db/migrate/20161102131604_create_profiles.rb deleted file mode 100644 index a69b84b9..00000000 --- a/db/migrate/20161102131604_create_profiles.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateProfiles < ActiveRecord::Migration[4.2] - def change - create_table :profiles do |t| - t.string :cv - t.references :user, index: true, foreign_key: true - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20161103093520_create_workshops.rb b/db/migrate/20161103093520_create_workshops.rb deleted file mode 100644 index 444d216d..00000000 --- a/db/migrate/20161103093520_create_workshops.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateWorkshops < ActiveRecord::Migration[4.2] - def change - create_table :workshops do |t| - t.string :name - t.string :description - t.integer :max_participants - t.boolean :active - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20161103101916_create_applications.rb b/db/migrate/20161103101916_create_applications.rb deleted file mode 100644 index 9fdb7950..00000000 --- a/db/migrate/20161103101916_create_applications.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateApplications < ActiveRecord::Migration[4.2] - def change - create_table :applications do |t| - t.string :motivation - t.references :user, index: true, foreign_key: true - t.references :workshop, index: true, foreign_key: true - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20161103103151_create_requests.rb b/db/migrate/20161103103151_create_requests.rb deleted file mode 100644 index fffc3241..00000000 --- a/db/migrate/20161103103151_create_requests.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateRequests < ActiveRecord::Migration[4.2] - def change - create_table :requests do |t| - t.string :topics - t.references :user, index: true, foreign_key: true - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20161107124714_rename_applications_to_application_letters.rb b/db/migrate/20161107124714_rename_applications_to_application_letters.rb deleted file mode 100644 index c25c130e..00000000 --- a/db/migrate/20161107124714_rename_applications_to_application_letters.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RenameApplicationsToApplicationLetters < ActiveRecord::Migration[4.2] - def change - rename_table :applications, :application_letters - end -end diff --git a/db/migrate/20161107131407_make_foreign_keys_not_nullable.rb b/db/migrate/20161107131407_make_foreign_keys_not_nullable.rb deleted file mode 100644 index 3594e895..00000000 --- a/db/migrate/20161107131407_make_foreign_keys_not_nullable.rb +++ /dev/null @@ -1,10 +0,0 @@ -class MakeForeignKeysNotNullable < ActiveRecord::Migration[4.2] - def change - change_column_null(:application_letters, :user_id, false) - change_column_null(:application_letters, :workshop_id, false) - - change_column_null(:profiles, :user_id, false) - - change_column_null(:requests, :user_id, false) - end -end diff --git a/db/migrate/20161114195923_add_private_data_to_profile.rb b/db/migrate/20161114195923_add_private_data_to_profile.rb deleted file mode 100644 index 0df6326a..00000000 --- a/db/migrate/20161114195923_add_private_data_to_profile.rb +++ /dev/null @@ -1,16 +0,0 @@ -class AddPrivateDataToProfile < ActiveRecord::Migration[4.2] - def change - add_column :profiles, :first_name, :string - add_column :profiles, :last_name, :string - add_column :profiles, :gender, :string - add_column :profiles, :birth_date, :date - add_column :profiles, :email, :string - add_column :profiles, :school, :string - add_column :profiles, :street_name, :string - add_column :profiles, :zip_code, :string - add_column :profiles, :city, :string - add_column :profiles, :state, :string - add_column :profiles, :country, :string - add_column :profiles, :graduates_school_in, :string - end -end diff --git a/db/migrate/20161116092838_add_role_to_users.rb b/db/migrate/20161116092838_add_role_to_users.rb deleted file mode 100644 index 35228ab0..00000000 --- a/db/migrate/20161116092838_add_role_to_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddRoleToUsers < ActiveRecord::Migration[4.2] - def change - add_column :users, :role, :string - end -end diff --git a/db/migrate/20161120123250_add_status_to_application_letter.rb b/db/migrate/20161120123250_add_status_to_application_letter.rb deleted file mode 100644 index c8f183bc..00000000 --- a/db/migrate/20161120123250_add_status_to_application_letter.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStatusToApplicationLetter < ActiveRecord::Migration[4.2] - def change - add_column :application_letters, :status, :boolean - end -end diff --git a/db/migrate/20161122144126_create_application_notes.rb b/db/migrate/20161122144126_create_application_notes.rb deleted file mode 100644 index e09c28a1..00000000 --- a/db/migrate/20161122144126_create_application_notes.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateApplicationNotes < ActiveRecord::Migration[4.2] - def change - create_table :application_notes do |t| - t.text :note - t.references :application_letter, index: true, foreign_key: true - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20161122151522_add_additional_information_to_application_letter.rb b/db/migrate/20161122151522_add_additional_information_to_application_letter.rb deleted file mode 100644 index 2796bc86..00000000 --- a/db/migrate/20161122151522_add_additional_information_to_application_letter.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddAdditionalInformationToApplicationLetter < ActiveRecord::Migration[4.2] - def change - add_column :application_letters, :grade, :integer - add_column :application_letters, :experience, :string - add_column :application_letters, :coding_skills, :string - add_column :application_letters, :emergency_number, :string - add_column :application_letters, :vegeterian, :boolean - add_column :application_letters, :vegan, :boolean - add_column :application_letters, :allergic, :boolean - add_column :application_letters, :allergies, :string - end -end diff --git a/db/migrate/20161123124500_change_workshop_to_event.rb b/db/migrate/20161123124500_change_workshop_to_event.rb deleted file mode 100644 index b36da003..00000000 --- a/db/migrate/20161123124500_change_workshop_to_event.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ChangeWorkshopToEvent < ActiveRecord::Migration[4.2] - def change - rename_table :workshops, :events - rename_column :application_letters, :workshop_id, :event_id - end -end diff --git a/db/migrate/20161125123712_add_date_ranges_to_event.rb b/db/migrate/20161125123712_add_date_ranges_to_event.rb deleted file mode 100644 index 83ce7abb..00000000 --- a/db/migrate/20161125123712_add_date_ranges_to_event.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddDateRangesToEvent < ActiveRecord::Migration[4.2] - def change - create_table :date_ranges do |t| - t.date :start_date - t.date :end_date - t.integer :event_id - t.timestamps - t.belongs_to :event, index: true - end - end -end diff --git a/db/migrate/20161125164958_create_agreement_letters.rb b/db/migrate/20161125164958_create_agreement_letters.rb deleted file mode 100644 index bdc3899c..00000000 --- a/db/migrate/20161125164958_create_agreement_letters.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateAgreementLetters < ActiveRecord::Migration[4.2] - def change - create_table :agreement_letters do |t| - t.references :user, index: true, foreign_key: true, null:false - t.references :event, index: true, foreign_key: true, null:false - t.string :path, null: false - - t.timestamps null: false - end - end -end diff --git a/db/migrate/20161126113138_add_kind_to_events.rb b/db/migrate/20161126113138_add_kind_to_events.rb deleted file mode 100644 index 36094b35..00000000 --- a/db/migrate/20161126113138_add_kind_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddKindToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :kind, :integer, default: 0 - end -end diff --git a/db/migrate/20161126190339_add_draft_to_events.rb b/db/migrate/20161126190339_add_draft_to_events.rb deleted file mode 100644 index c875b20e..00000000 --- a/db/migrate/20161126190339_add_draft_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDraftToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :draft, :boolean - end -end diff --git a/db/migrate/20161129110700_add_organizer_to_workshops.rb b/db/migrate/20161129110700_add_organizer_to_workshops.rb deleted file mode 100644 index 99d58dc7..00000000 --- a/db/migrate/20161129110700_add_organizer_to_workshops.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddOrganizerToWorkshops < ActiveRecord::Migration[4.2] - def self.up - add_column :events, :organizer, :string unless column_exists?(:events, :organizer) - end - - def self.down - Profile.reset_column_information - remove_column :events, :organizer, :string if column_exists?(:events, :organizer) - end -end diff --git a/db/migrate/20161129111916_add_knowledge_level_to_workshops.rb b/db/migrate/20161129111916_add_knowledge_level_to_workshops.rb deleted file mode 100644 index 5e25aa19..00000000 --- a/db/migrate/20161129111916_add_knowledge_level_to_workshops.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddKnowledgeLevelToWorkshops < ActiveRecord::Migration[4.2] - def self.up - add_column :events, :knowledge_level, :string unless column_exists?(:events, :knowledge_level) - end - - def self.down - Profile.reset_column_information - remove_column :events, :knowledge_level, :string if column_exists?(:events, :knowledge_level) - end -end diff --git a/db/migrate/20161129120651_add_default_value_to_application_status.rb b/db/migrate/20161129120651_add_default_value_to_application_status.rb deleted file mode 100644 index 3d6e8150..00000000 --- a/db/migrate/20161129120651_add_default_value_to_application_status.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddDefaultValueToApplicationStatus < ActiveRecord::Migration[4.2] - def change - change_column :application_letters, :status, 'integer USING CAST(status AS integer)', default: 2 - change_column_null :application_letters, :status, false, 2 - end -end diff --git a/db/migrate/20161129121741_remove_c_vand_email_from_profile.rb b/db/migrate/20161129121741_remove_c_vand_email_from_profile.rb deleted file mode 100644 index a008a0d1..00000000 --- a/db/migrate/20161129121741_remove_c_vand_email_from_profile.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveCVandEmailFromProfile < ActiveRecord::Migration[4.2] - def change - remove_column :profiles, :cv, :string - remove_column :profiles, :email, :string - end -end diff --git a/db/migrate/20161129131315_rename_tutor_to_coach.rb b/db/migrate/20161129131315_rename_tutor_to_coach.rb deleted file mode 100644 index 98595e82..00000000 --- a/db/migrate/20161129131315_rename_tutor_to_coach.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RenameTutorToCoach < ActiveRecord::Migration[4.2] - def up - execute "UPDATE users SET role = 'coach' WHERE role = 'tutor'" - end - - def down - execute "UPDATE users SET role = 'tutor' WHERE role = 'coach'" - end -end diff --git a/db/migrate/20161204205355_add_application_deadline_to_events.rb b/db/migrate/20161204205355_add_application_deadline_to_events.rb deleted file mode 100644 index 8ae718c0..00000000 --- a/db/migrate/20161204205355_add_application_deadline_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddApplicationDeadlineToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :application_deadline, :date - end -end diff --git a/db/migrate/20161207094400_add_application_status_locked_to_events.rb b/db/migrate/20161207094400_add_application_status_locked_to_events.rb deleted file mode 100644 index a4d44a1b..00000000 --- a/db/migrate/20161207094400_add_application_status_locked_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddApplicationStatusLockedToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :application_status_locked, :boolean - end -end diff --git a/db/migrate/20161209180054_remove_active_from_event.rb b/db/migrate/20161209180054_remove_active_from_event.rb deleted file mode 100644 index 78233a0b..00000000 --- a/db/migrate/20161209180054_remove_active_from_event.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveActiveFromEvent < ActiveRecord::Migration[4.2] - def change - remove_column :events, :active, :boolean - end -end diff --git a/db/migrate/20161222154024_remove_name_from_users.rb b/db/migrate/20161222154024_remove_name_from_users.rb deleted file mode 100644 index 35e9cee2..00000000 --- a/db/migrate/20161222154024_remove_name_from_users.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveNameFromUsers < ActiveRecord::Migration[4.2] - def change - remove_column :users, :name, :string - end -end diff --git a/db/migrate/20170104135212_add_fields_to_requests.rb b/db/migrate/20170104135212_add_fields_to_requests.rb deleted file mode 100644 index 43980f22..00000000 --- a/db/migrate/20170104135212_add_fields_to_requests.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AddFieldsToRequests < ActiveRecord::Migration[4.2] - def change - remove_column :requests, :topics, :string - remove_column :requests, :user_id, :integer - add_column :requests, :form_of_address, :integer - add_column :requests, :first_name, :string - add_column :requests, :last_name, :string - add_column :requests, :phone_number, :string - add_column :requests, :address, :string - add_column :requests, :email, :string - add_column :requests, :topic_of_workshop, :text - add_column :requests, :time_period, :text - add_column :requests, :number_of_participants, :integer - add_column :requests, :knowledge_level, :string - add_column :requests, :annotations, :text - end -end diff --git a/db/migrate/20170107140419_create_email_templates.rb b/db/migrate/20170107140419_create_email_templates.rb deleted file mode 100644 index ae954dad..00000000 --- a/db/migrate/20170107140419_create_email_templates.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateEmailTemplates < ActiveRecord::Migration[4.2] - def change - create_table :email_templates do |t| - t.integer :status - t.string :subject - t.text :content - t.boolean :hide_recipients - end - end -end diff --git a/db/migrate/20170108122417_add_status_to_requests.rb b/db/migrate/20170108122417_add_status_to_requests.rb deleted file mode 100644 index 36b34916..00000000 --- a/db/migrate/20170108122417_add_status_to_requests.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStatusToRequests < ActiveRecord::Migration[4.2] - def change - add_column :requests, :status, :integer, default: 0 - end -end diff --git a/db/migrate/20170110132223_add_unlimited_participants_to_events.rb b/db/migrate/20170110132223_add_unlimited_participants_to_events.rb deleted file mode 100644 index e1704ff1..00000000 --- a/db/migrate/20170110132223_add_unlimited_participants_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddUnlimitedParticipantsToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :participants_are_unlimited, :boolean, default: false - end -end diff --git a/db/migrate/20170111135212_rename_draft_to_published.rb b/db/migrate/20170111135212_rename_draft_to_published.rb deleted file mode 100644 index 6ea70e13..00000000 --- a/db/migrate/20170111135212_rename_draft_to_published.rb +++ /dev/null @@ -1,14 +0,0 @@ -class RenameDraftToPublished < ActiveRecord::Migration[4.2] - def change - reversible do |dir| - dir.up do - Event.all.each {|e| e.toggle!(:draft)} - end - dir.down do - Event.all.each {|e| e.toggle!(:draft)} - end - end - - rename_column :events, :draft, :published - end -end diff --git a/db/migrate/20170113083747_add_custom_application_fields_to_event.rb b/db/migrate/20170113083747_add_custom_application_fields_to_event.rb deleted file mode 100644 index 37ba865a..00000000 --- a/db/migrate/20170113083747_add_custom_application_fields_to_event.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCustomApplicationFieldsToEvent < ActiveRecord::Migration[4.2] - def change - add_column :events, :custom_application_fields, :text - end -end diff --git a/db/migrate/20170114132153_change_address_fields.rb b/db/migrate/20170114132153_change_address_fields.rb deleted file mode 100644 index f3dfcf70..00000000 --- a/db/migrate/20170114132153_change_address_fields.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ChangeAddressFields < ActiveRecord::Migration[4.2] - def change - rename_column :requests, :address, :street - add_column :requests, :zip_code_city, :string - end -end diff --git a/db/migrate/20170116093536_add_custom_application_fields_to_application_letters.rb b/db/migrate/20170116093536_add_custom_application_fields_to_application_letters.rb deleted file mode 100644 index 5bbc364c..00000000 --- a/db/migrate/20170116093536_add_custom_application_fields_to_application_letters.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCustomApplicationFieldsToApplicationLetters < ActiveRecord::Migration[4.2] - def change - add_column :application_letters, :custom_application_fields, :text - end -end diff --git a/db/migrate/20170118161954_rename_vegeterian_to_vegetarian.rb b/db/migrate/20170118161954_rename_vegeterian_to_vegetarian.rb deleted file mode 100644 index 97b2e3b4..00000000 --- a/db/migrate/20170118161954_rename_vegeterian_to_vegetarian.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RenameVegeterianToVegetarian < ActiveRecord::Migration[4.2] - def change - rename_column :application_letters, :vegeterian, :vegetarian - end -end diff --git a/db/migrate/20170119223355_add_contact_person_to_requests.rb b/db/migrate/20170119223355_add_contact_person_to_requests.rb deleted file mode 100644 index b2c96dcc..00000000 --- a/db/migrate/20170119223355_add_contact_person_to_requests.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContactPersonToRequests < ActiveRecord::Migration[4.2] - def change - add_column :requests, :contact_person, :string - end -end diff --git a/db/migrate/20170120183139_change_request_description_to_textfield.rb b/db/migrate/20170120183139_change_request_description_to_textfield.rb deleted file mode 100644 index 08ebf7ab..00000000 --- a/db/migrate/20170120183139_change_request_description_to_textfield.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ChangeRequestDescriptionToTextfield < ActiveRecord::Migration[4.2] - def change - change_column :events, :description, :text - end -end diff --git a/db/migrate/20170122191752_create_participant_groups.rb b/db/migrate/20170122191752_create_participant_groups.rb deleted file mode 100644 index 987b6321..00000000 --- a/db/migrate/20170122191752_create_participant_groups.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateParticipantGroups < ActiveRecord::Migration[4.2] - def change - create_table :participant_groups do |t| - t.references :user, index: true, foreign_key: true - t.references :event, index: true, foreign_key: true - t.integer :group, null: false - end - end -end diff --git a/db/migrate/20170123161527_add_hidden_to_event.rb b/db/migrate/20170123161527_add_hidden_to_event.rb deleted file mode 100644 index 8ad24fbf..00000000 --- a/db/migrate/20170123161527_add_hidden_to_event.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddHiddenToEvent < ActiveRecord::Migration[4.2] - def change - add_column :events, :hidden, :boolean - end -end diff --git a/db/migrate/20170123205418_add_notes_to_requests.rb b/db/migrate/20170123205418_add_notes_to_requests.rb deleted file mode 100644 index d220da0f..00000000 --- a/db/migrate/20170123205418_add_notes_to_requests.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddNotesToRequests < ActiveRecord::Migration[4.2] - def change - add_column :requests, :notes, :text - end -end diff --git a/db/migrate/20170124225558_add_annotation_to_application_letters.rb b/db/migrate/20170124225558_add_annotation_to_application_letters.rb deleted file mode 100644 index 0e6ed0df..00000000 --- a/db/migrate/20170124225558_add_annotation_to_application_letters.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddAnnotationToApplicationLetters < ActiveRecord::Migration[4.2] - def change - add_column :application_letters, :annotation, :text - end -end diff --git a/db/migrate/20170125201341_add_image_to_events.rb b/db/migrate/20170125201341_add_image_to_events.rb deleted file mode 100644 index 44526e21..00000000 --- a/db/migrate/20170125201341_add_image_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddImageToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :image, :string - end -end diff --git a/db/migrate/20170128122851_add_discovery_of_site_to_profiles.rb b/db/migrate/20170128122851_add_discovery_of_site_to_profiles.rb deleted file mode 100644 index 89d35c08..00000000 --- a/db/migrate/20170128122851_add_discovery_of_site_to_profiles.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDiscoveryOfSiteToProfiles < ActiveRecord::Migration[4.2] - def change - add_column :profiles, :discovery_of_site, :text - end -end diff --git a/db/migrate/20170201110130_remove_school_from_profile.rb b/db/migrate/20170201110130_remove_school_from_profile.rb deleted file mode 100644 index 80c63d9e..00000000 --- a/db/migrate/20170201110130_remove_school_from_profile.rb +++ /dev/null @@ -1,7 +0,0 @@ -class RemoveSchoolFromProfile < ActiveRecord::Migration[4.2] - def change - remove_column :profiles, :school, :string - remove_column :profiles, :graduates_school_in, :string - add_column :application_letters, :organisation, :string - end -end diff --git a/db/migrate/20170201115658_remove_experience_from_application_letters.rb b/db/migrate/20170201115658_remove_experience_from_application_letters.rb deleted file mode 100644 index 8df75991..00000000 --- a/db/migrate/20170201115658_remove_experience_from_application_letters.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveExperienceFromApplicationLetters < ActiveRecord::Migration[4.2] - def change - remove_column :application_letters, :experience, :string - end -end diff --git a/db/migrate/20170201131446_add_default_value_to_published.rb b/db/migrate/20170201131446_add_default_value_to_published.rb deleted file mode 100644 index e62208ed..00000000 --- a/db/migrate/20170201131446_add_default_value_to_published.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddDefaultValueToPublished < ActiveRecord::Migration[4.2] - def up - change_column :events, :published, :boolean, :default => false - end - - def down - change_column :events, :published, :boolean, :default => nil - end -end diff --git a/db/migrate/20170201132359_add_default_value_to_hidden.rb b/db/migrate/20170201132359_add_default_value_to_hidden.rb deleted file mode 100644 index 92e2e0d4..00000000 --- a/db/migrate/20170201132359_add_default_value_to_hidden.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddDefaultValueToHidden < ActiveRecord::Migration[4.2] - def up - change_column :events, :hidden, :boolean, :default => false - end - - def down - change_column :events, :hidden, :boolean, :default => nil - end -end diff --git a/db/migrate/20170201141415_remove_kind_from_events.rb b/db/migrate/20170201141415_remove_kind_from_events.rb deleted file mode 100644 index 8ff57512..00000000 --- a/db/migrate/20170201141415_remove_kind_from_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveKindFromEvents < ActiveRecord::Migration[4.2] - def change - remove_column :events, :kind, :string - end -end diff --git a/db/migrate/20170201150603_remove_participants_are_unlimited_from_events.rb b/db/migrate/20170201150603_remove_participants_are_unlimited_from_events.rb deleted file mode 100644 index a41b46d4..00000000 --- a/db/migrate/20170201150603_remove_participants_are_unlimited_from_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveParticipantsAreUnlimitedFromEvents < ActiveRecord::Migration[4.2] - def change - remove_column :events, :participants_are_unlimited, :boolean - end -end diff --git a/db/migrate/20170201154540_remove_allergic_from_application_letter.rb b/db/migrate/20170201154540_remove_allergic_from_application_letter.rb deleted file mode 100644 index e79b1f17..00000000 --- a/db/migrate/20170201154540_remove_allergic_from_application_letter.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveAllergicFromApplicationLetter < ActiveRecord::Migration[4.2] - def change - remove_column :application_letters, :allergic - end -end diff --git a/db/migrate/20170201201804_remove_application_status_locked_from_events.rb b/db/migrate/20170201201804_remove_application_status_locked_from_events.rb deleted file mode 100644 index 0ec45a76..00000000 --- a/db/migrate/20170201201804_remove_application_status_locked_from_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveApplicationStatusLockedFromEvents < ActiveRecord::Migration[4.2] - def change - remove_column :events, :application_status_locked, :boolean - end -end diff --git a/db/migrate/20170201201819_add_rejections_have_been_sent_to_events.rb b/db/migrate/20170201201819_add_rejections_have_been_sent_to_events.rb deleted file mode 100644 index df8859f8..00000000 --- a/db/migrate/20170201201819_add_rejections_have_been_sent_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddRejectionsHaveBeenSentToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :rejections_have_been_sent, :boolean, default: false - end -end diff --git a/db/migrate/20170201201932_add_acceptances_have_been_sent_to_events.rb b/db/migrate/20170201201932_add_acceptances_have_been_sent_to_events.rb deleted file mode 100644 index eed21653..00000000 --- a/db/migrate/20170201201932_add_acceptances_have_been_sent_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddAcceptancesHaveBeenSentToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :acceptances_have_been_sent, :boolean, default: false - end -end diff --git a/db/migrate/20170203150152_remove_fields_from_application.rb b/db/migrate/20170203150152_remove_fields_from_application.rb deleted file mode 100644 index 88c3c623..00000000 --- a/db/migrate/20170203150152_remove_fields_from_application.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveFieldsFromApplication < ActiveRecord::Migration[4.2] - def change - remove_column :application_letters, :grade, :integer - remove_column :application_letters, :coding_skills, :string - end -end diff --git a/db/migrate/20170203180638_add_status_notification_sent_to_application_letters.rb b/db/migrate/20170203180638_add_status_notification_sent_to_application_letters.rb deleted file mode 100644 index fd48af1b..00000000 --- a/db/migrate/20170203180638_add_status_notification_sent_to_application_letters.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddStatusNotificationSentToApplicationLetters < ActiveRecord::Migration[4.2] - def change - add_column :application_letters, :status_notification_sent, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20170207133819_add_custom_image_to_events.rb b/db/migrate/20170207133819_add_custom_image_to_events.rb deleted file mode 100644 index 7aac0ee9..00000000 --- a/db/migrate/20170207133819_add_custom_image_to_events.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddCustomImageToEvents < ActiveRecord::Migration[4.2] - def change - add_column :events, :custom_image, :string - end -end diff --git a/db/migrate/20170605080836_add_omniauth_to_users.rb b/db/migrate/20170605080836_add_omniauth_to_users.rb deleted file mode 100644 index 2f056a67..00000000 --- a/db/migrate/20170605080836_add_omniauth_to_users.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddOmniauthToUsers < ActiveRecord::Migration[4.2] - def change - add_column :users, :provider, :string - add_column :users, :uid, :string - end -end diff --git a/db/migrate/20170605080836_init_schema.rb b/db/migrate/20170605080836_init_schema.rb new file mode 100644 index 00000000..a5bae1af --- /dev/null +++ b/db/migrate/20170605080836_init_schema.rb @@ -0,0 +1,134 @@ +class InitSchema < ActiveRecord::Migration[5.1] + def up + create_table "agreement_letters", force: :cascade do |t| + t.integer "user_id", null: false + t.integer "event_id", null: false + t.string "path", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["event_id"], name: "index_agreement_letters_on_event_id" + t.index ["user_id"], name: "index_agreement_letters_on_user_id" + end + create_table "application_letters", force: :cascade do |t| + t.string "motivation" + t.integer "user_id", null: false + t.integer "event_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "status", default: 2, null: false + t.string "emergency_number" + t.boolean "vegetarian" + t.boolean "vegan" + t.string "allergies" + t.text "custom_application_fields" + t.text "annotation" + t.string "organisation" + t.boolean "status_notification_sent", default: false, null: false + t.index ["event_id"], name: "index_application_letters_on_event_id" + t.index ["user_id"], name: "index_application_letters_on_user_id" + end + create_table "application_notes", force: :cascade do |t| + t.text "note" + t.integer "application_letter_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["application_letter_id"], name: "index_application_notes_on_application_letter_id" + end + create_table "date_ranges", force: :cascade do |t| + t.date "start_date" + t.date "end_date" + t.integer "event_id" + t.datetime "created_at" + t.datetime "updated_at" + t.index ["event_id"], name: "index_date_ranges_on_event_id" + end + create_table "email_templates", force: :cascade do |t| + t.integer "status" + t.string "subject" + t.text "content" + t.boolean "hide_recipients" + end + create_table "events", force: :cascade do |t| + t.string "name" + t.text "description" + t.integer "max_participants" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "published", default: false + t.string "organizer" + t.string "knowledge_level" + t.date "application_deadline" + t.text "custom_application_fields" + t.boolean "hidden", default: false + t.string "image" + t.boolean "rejections_have_been_sent", default: false + t.boolean "acceptances_have_been_sent", default: false + t.string "custom_image" + end + create_table "participant_groups", force: :cascade do |t| + t.integer "user_id" + t.integer "event_id" + t.integer "group", null: false + t.index ["event_id"], name: "index_participant_groups_on_event_id" + t.index ["user_id"], name: "index_participant_groups_on_user_id" + end + create_table "profiles", force: :cascade do |t| + t.integer "user_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "first_name" + t.string "last_name" + t.string "gender" + t.date "birth_date" + t.string "street_name" + t.string "zip_code" + t.string "city" + t.string "state" + t.string "country" + t.text "discovery_of_site" + t.index ["user_id"], name: "index_profiles_on_user_id" + end + create_table "requests", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "form_of_address" + t.string "first_name" + t.string "last_name" + t.string "phone_number" + t.string "street" + t.string "email" + t.text "topic_of_workshop" + t.text "time_period" + t.integer "number_of_participants" + t.string "knowledge_level" + t.text "annotations" + t.integer "status", default: 0 + t.string "zip_code_city" + t.string "contact_person" + t.text "notes" + end + create_table "users", force: :cascade 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, null: false + 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.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "role" + t.string "provider" + t.string "uid" + t.index ["email"], name: "index_users_on_email", unique: true + t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + end + end + + def down + raise ActiveRecord::IrreversibleMigration, "The initial migration is not revertable" + end +end