-
Notifications
You must be signed in to change notification settings - Fork 6
Organization HABTM Workshops #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't want the organizations controller anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't mean to include an empty controller in the last PR, so my thinking was that I'd remove it until we actually need it. |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| class OrganizationWorkshop < ApplicationRecord | ||
| belongs_to :organization | ||
| belongs_to :workshop | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| class ChangeOrganizationsIdToInteger < ActiveRecord::Migration[8.1] | ||
| def change | ||
| # Drop foreign keys first | ||
| remove_foreign_key :addresses, :organizations | ||
| remove_foreign_key :facilitator_organizations, :organizations | ||
|
|
||
| # Change column types | ||
| change_column :organizations, :id, :integer | ||
| change_column :addresses, :organization_id, :integer | ||
| change_column :facilitator_organizations, :organization_id, :integer | ||
|
|
||
| # Re-add foreign keys | ||
| add_foreign_key :addresses, :organizations | ||
| add_foreign_key :facilitator_organizations, :organizations | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| class CreateOrganizationWorkshops < ActiveRecord::Migration[8.1] | ||
| def change | ||
| create_table :organization_workshops do |t| | ||
| t.references :organization, null: false, foreign_key: true, type: :integer | ||
| t.references :workshop, null: false, foreign_key: true, type: :integer | ||
|
|
||
| t.timestamps | ||
| end | ||
|
|
||
| add_index :organization_workshops, [:organization_id, :workshop_id], unique: true, name: 'index_organization_workshops_on_ids' | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| class ChangeFacilitatorsIdToInteger < ActiveRecord::Migration[8.1] | ||
| def change | ||
| # Drop foreign keys first | ||
| remove_foreign_key :facilitator_organizations, :facilitators | ||
| remove_foreign_key :users, :facilitators | ||
|
|
||
| # Change column types | ||
| change_column :facilitators, :id, :integer | ||
| change_column :facilitator_organizations, :facilitator_id, :integer | ||
| change_column :users, :facilitator_id, :integer | ||
|
|
||
| # Re-add foreign keys | ||
| add_foreign_key :facilitator_organizations, :facilitators | ||
| add_foreign_key :users, :facilitators | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this controller deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an empty controller not serving any purpose, so I actually never meant to include it in the initial PR, and thought we could add it back in if we need it in the future.