diff --git a/db/migrate/002_group_and_team_changes.rb b/db/migrate/002_group_and_team_changes.rb index d988573aa..39aa66fda 100644 --- a/db/migrate/002_group_and_team_changes.rb +++ b/db/migrate/002_group_and_team_changes.rb @@ -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 @@ -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 @@ -81,4 +81,4 @@ def down remove_column :grouppasswords, :team_admin end -end \ No newline at end of file +end diff --git a/db/migrate/004_add_no_root_flag_to_teams.rb b/db/migrate/004_add_no_root_flag_to_teams.rb index c62109838..ee7889652 100644 --- a/db/migrate/004_add_no_root_flag_to_teams.rb +++ b/db/migrate/004_add_no_root_flag_to_teams.rb @@ -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 diff --git a/db/migrate/20190604054153_sqlite_boolean_values.rb b/db/migrate/20190604054153_sqlite_boolean_values.rb index b399aa529..858f4d4b3 100644 --- a/db/migrate/20190604054153_sqlite_boolean_values.rb +++ b/db/migrate/20190604054153_sqlite_boolean_values.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 8d5dfb6e9..53367d69c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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