Skip to content

Commit

Permalink
Comment out failing and not required anymore db migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mtnstar committed Jun 26, 2024
1 parent d73ea8d commit bef38a4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
36 changes: 18 additions & 18 deletions db/migrate/002_group_and_team_changes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def up
rename_column :teams, :groupname, :name
add_column :teams, :visible, :boolean, default: true, null: false
add_column :teams, :private, :boolean, default: false, null: false
Team.find_each do |team|
teammember = Teammember.first(conditions: ["user_id = ? and team_id = ?", team.user_id, team.id])
teammember.team_admin = true
teammember.save
end
#Team.find_each do |team|
#teammember = Teammember.first(conditions: ["user_id = ? and team_id = ?", team.user_id, team.id])
#teammember.team_admin = true
#teammember.save
#end
remove_column :teams, :user_id

# Add the new admin flag to the users table
Expand All @@ -33,19 +33,19 @@ def up
end

# create a default group for every team with accounts
Team.find_each do |team|
group = Group.new()
group.name = "Default"
group.description = "Default group, created for migration"
group.team_id = team.id
group.save
#Team.find_each do |team|
#group = Group.new()
#group.name = "Default"
#group.description = "Default group, created for migration"
#group.team_id = team.id
#group.save

# Accounts are now linked to their groups and not directly to the team
Account.where("group_id = ?", team.id).find_each do |account|
account.group_id = group.id
account.save
end
end
## Accounts are now linked to their groups and not directly to the team
#Account.where("group_id = ?", team.id).find_each do |account|
#account.group_id = group.id
#account.save
#end
#end

end

Expand Down Expand Up @@ -81,4 +81,4 @@ def down
remove_column :grouppasswords, :team_admin

end
end
end
10 changes: 5 additions & 5 deletions db/migrate/004_add_no_root_flag_to_teams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class AddNoRootFlagToTeams < ActiveRecord::Migration[4.2]
def change
add_column :teams, :noroot, :boolean, default: 0, null: false

Team.reset_column_information
Team.find_each do |team|
team.noroot = false
team.save
end
#Team.reset_column_information
#Team.find_each do |team|
#team.noroot = false
#team.save
#end
end
end
12 changes: 6 additions & 6 deletions db/migrate/20190604054153_sqlite_boolean_values.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ class SqliteBooleanValues < ActiveRecord::Migration[5.2]
def up
return unless sqlite?

User.where("locked = 't'").update_all(locked: 1)
User.where("locked = 'f'").update_all(locked: 0)
#User.where("locked = 't'").update_all(locked: 1)
#User.where("locked = 'f'").update_all(locked: 0)

Team.where("visible = 't'").update_all(visible: 1)
Team.where("visible = 'f'").update_all(visible: 0)
#Team.where("visible = 't'").update_all(visible: 1)
#Team.where("visible = 'f'").update_all(visible: 0)

Team.where("private = 't'").update_all(private: 1)
Team.where("private = 'f'").update_all(private: 0)
#Team.where("private = 't'").update_all(private: 1)
#Team.where("private = 'f'").update_all(private: 0)
end

private
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

ActiveRecord::Schema[7.1].define(version: 2022_07_19_120958) do
create_table "encryptables", force: :cascade do |t|
t.string "name", limit: 255, default: "", null: false
t.string "name", limit: 255
t.integer "folder_id"
t.text "description"
t.datetime "created_at", precision: nil, null: false
Expand Down

0 comments on commit bef38a4

Please sign in to comment.