diff --git a/db/migrate/20240813200622_rename_organizations_to_accounts.rb b/db/migrate/20240813200622_rename_organizations_to_accounts.rb index e6ec31e42..a0fbe2ec2 100644 --- a/db/migrate/20240813200622_rename_organizations_to_accounts.rb +++ b/db/migrate/20240813200622_rename_organizations_to_accounts.rb @@ -1,9 +1,6 @@ class RenameOrganizationsToAccounts < ActiveRecord::Migration[8.0] def change rename_table :organizations, :accounts - add_index :accounts, :name, unique: true - rename_column :users, :organization_id, :account_id - add_index :users, :account_id end end diff --git a/db/migrate/20240916191616_create_projects.rb b/db/migrate/20240916191616_create_projects.rb index c537d2f40..9d12b0066 100644 --- a/db/migrate/20240916191616_create_projects.rb +++ b/db/migrate/20240916191616_create_projects.rb @@ -7,7 +7,5 @@ class CreateProjects < ActiveRecord::Migration[8.0] t.timestamps end - - Account.first.projects.create! name: "Writebook", creator: User.first end end diff --git a/db/migrate/20240916193936_add_project_to_bubbles.rb b/db/migrate/20240916193936_add_project_to_bubbles.rb index 58069b98f..5ec29cbba 100644 --- a/db/migrate/20240916193936_add_project_to_bubbles.rb +++ b/db/migrate/20240916193936_add_project_to_bubbles.rb @@ -4,7 +4,8 @@ class AddProjectToBubbles < ActiveRecord::Migration[8.0] t.references :project, null: true end - Bubble.update_all project_id: Project.first.id + execute "update bubbles set project_id = (select id from projects limit 1)" + change_column_null :bubbles, :project_id, false end end diff --git a/db/migrate/20241001200953_add_account_to_tags.rb b/db/migrate/20241001200953_add_account_to_tags.rb index 6a20b6836..56243f0d1 100644 --- a/db/migrate/20241001200953_add_account_to_tags.rb +++ b/db/migrate/20241001200953_add_account_to_tags.rb @@ -4,7 +4,8 @@ class AddAccountToTags < ActiveRecord::Migration[8.0] t.references :account, null: true end - Tag.update_all account_id: Account.first.id + execute "update tags set account_id = (select id from accounts limit 1)" + change_column_null :tags, :account_id, false end end