diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-01 22:21:27 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-01 22:21:27 +0100 |
commit | fcc9440a6dc3e03b989dd346186cc4b9d532bc8b (patch) | |
tree | f1f8df193e5c2e13abae37f23dca1a9a73ea6dd7 | |
parent | ee5056fb56ad0a00924d8ba87543106f518b4a11 (diff) | |
download | ecs-fcc9440a6dc3e03b989dd346186cc4b9d532bc8b.tar.gz ecs-fcc9440a6dc3e03b989dd346186cc4b9d532bc8b.zip |
Initial migrations.
25 files changed, 729 insertions, 0 deletions
diff --git a/db/migrate/20091006133635_create_sessions.rb b/db/migrate/20091006133635_create_sessions.rb new file mode 100644 index 0000000..e9f4c11 --- /dev/null +++ b/db/migrate/20091006133635_create_sessions.rb @@ -0,0 +1,34 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateSessions < ActiveRecord::Migration + def self.up + create_table :sessions do |t| + t.string :session_id, :null => false + t.text :data + t.timestamps + end + + add_index :sessions, :session_id + add_index :sessions, :updated_at + end + + def self.down + drop_table :sessions + end +end diff --git a/db/migrate/20100121203546_create_participants.rb b/db/migrate/20100121203546_create_participants.rb new file mode 100644 index 0000000..1b4d0f0 --- /dev/null +++ b/db/migrate/20100121203546_create_participants.rb @@ -0,0 +1,37 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateParticipants < ActiveRecord::Migration + def self.up + create_table :participants do |t| + t.string :name + t.string :dns + t.string :email + t.text :description + t.integer :organization_id + t.datetime :ttl, :null => true, :default => nil + t.boolean :anonymous, :null => false, :default => false + + t.timestamps + end + end + + def self.down + drop_table :participants + end +end diff --git a/db/migrate/20100121205728_create_communities.rb b/db/migrate/20100121205728_create_communities.rb new file mode 100644 index 0000000..dc566d8 --- /dev/null +++ b/db/migrate/20100121205728_create_communities.rb @@ -0,0 +1,32 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateCommunities < ActiveRecord::Migration + def self.up + create_table :communities do |t| + t.string :name + t.text :description + + t.timestamps + end + end + + def self.down + drop_table :communities + end +end diff --git a/db/migrate/20100121205935_create_memberships.rb b/db/migrate/20100121205935_create_memberships.rb new file mode 100644 index 0000000..9c09ec6 --- /dev/null +++ b/db/migrate/20100121205935_create_memberships.rb @@ -0,0 +1,32 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateMemberships < ActiveRecord::Migration + def self.up + create_table :memberships do |t| + t.integer :participant_id + t.integer :community_id + + t.timestamps + end + end + + def self.down + drop_table :memberships + end +end diff --git a/db/migrate/20100121210405_create_organizations.rb b/db/migrate/20100121210405_create_organizations.rb new file mode 100644 index 0000000..515c2b1 --- /dev/null +++ b/db/migrate/20100121210405_create_organizations.rb @@ -0,0 +1,33 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateOrganizations < ActiveRecord::Migration + def self.up + create_table :organizations do |t| + t.string :name + t.text :description + t.string :abrev + + t.timestamps + end + end + + def self.down + drop_table :organizations + end +end diff --git a/db/migrate/20100131022034_create_identities.rb b/db/migrate/20100131022034_create_identities.rb new file mode 100644 index 0000000..5d533ab --- /dev/null +++ b/db/migrate/20100131022034_create_identities.rb @@ -0,0 +1,33 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateIdentities < ActiveRecord::Migration + def self.up + create_table :identities do |t| + t.integer :participant_id + t.string :name + t.text :description + + t.timestamps + end + end + + def self.down + drop_table :identities + end +end diff --git a/db/migrate/20100205192422_create_messages.rb b/db/migrate/20100205192422_create_messages.rb new file mode 100644 index 0000000..8f7541f --- /dev/null +++ b/db/migrate/20100205192422_create_messages.rb @@ -0,0 +1,34 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateMessages < ActiveRecord::Migration + def self.up + create_table :messages do |t| + t.string :content_type, :x_ecs_receiver_communities, :x_ecs_receiver_memberships, :null => true, :default => nil + t.integer :sender, :null => true, :default => nil + t.text :body, :null => true, :default => nil + + t.integer :ressource_id + t.timestamps + end + end + + def self.down + drop_table :messages + end +end diff --git a/db/migrate/20100205192757_create_membership_messages.rb b/db/migrate/20100205192757_create_membership_messages.rb new file mode 100644 index 0000000..c062f76 --- /dev/null +++ b/db/migrate/20100205192757_create_membership_messages.rb @@ -0,0 +1,32 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateMembershipMessages < ActiveRecord::Migration + def self.up + create_table :membership_messages do |t| + t.integer :membership_id + t.integer :message_id + + t.timestamps + end + end + + def self.down + drop_table :membership_messages + end +end diff --git a/db/migrate/20100406115338_create_ressources.rb b/db/migrate/20100406115338_create_ressources.rb new file mode 100644 index 0000000..3e14de3 --- /dev/null +++ b/db/migrate/20100406115338_create_ressources.rb @@ -0,0 +1,32 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateRessources < ActiveRecord::Migration + def self.up + create_table :ressources do |t| + t.string :namespace, :ressource, :null => true, :default => nil + t.boolean :postroute, :null => true, :default => false + + t.timestamps + end + end + + def self.down + drop_table :ressources + end +end diff --git a/db/migrate/20100425195021_add_monitor_to_message.rb b/db/migrate/20100425195021_add_monitor_to_message.rb new file mode 100644 index 0000000..81d4282 --- /dev/null +++ b/db/migrate/20100425195021_add_monitor_to_message.rb @@ -0,0 +1,34 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class AddMonitorToMessage < ActiveRecord::Migration + def self.up + add_column :messages, :lock_version, :integer, :default => 0 + add_column :messages, :monitor, :integer, :default => 0 + #Message.all.each do |m| + # m.lock_version = 0 + # m.monitor = false + # m.save + #end + end + + def self.down + remove_column :messages, :monitor + remove_column :messages, :lock_version + end +end diff --git a/db/migrate/20100802085027_remove_columns_from_message.rb b/db/migrate/20100802085027_remove_columns_from_message.rb new file mode 100644 index 0000000..573ed66 --- /dev/null +++ b/db/migrate/20100802085027_remove_columns_from_message.rb @@ -0,0 +1,29 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class RemoveColumnsFromMessage < ActiveRecord::Migration + def self.up + remove_column :messages, :lock_version + remove_column :messages, :monitor + end + + def self.down + add_column :messages, :monitor, :integer + add_column :messages, :lock_version, :integer + end +end diff --git a/db/migrate/20101109101215_create_ev_types.rb b/db/migrate/20101109101215_create_ev_types.rb new file mode 100644 index 0000000..caa5b64 --- /dev/null +++ b/db/migrate/20101109101215_create_ev_types.rb @@ -0,0 +1,31 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateEvTypes < ActiveRecord::Migration + def self.up + create_table :ev_types do |t| + t.string :name + + t.timestamps + end + end + + def self.down + drop_table :ev_types + end +end diff --git a/db/migrate/20101109141511_create_events.rb b/db/migrate/20101109141511_create_events.rb new file mode 100644 index 0000000..64f49d5 --- /dev/null +++ b/db/migrate/20101109141511_create_events.rb @@ -0,0 +1,33 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateEvents < ActiveRecord::Migration + def self.up + create_table :events do |t| + t.integer :participant_id + t.integer :message_id + t.integer :ev_type_id + + t.timestamps + end + end + + def self.down + drop_table :events + end +end diff --git a/db/migrate/20101117081838_add_lock_version_to_membership_messages.rb b/db/migrate/20101117081838_add_lock_version_to_membership_messages.rb new file mode 100644 index 0000000..b4d103a --- /dev/null +++ b/db/migrate/20101117081838_add_lock_version_to_membership_messages.rb @@ -0,0 +1,27 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class AddLockVersionToMembershipMessages < ActiveRecord::Migration + def self.up + add_column :membership_messages, :lock_version, :integer, :default => 0 + end + + def self.down + remove_column :membership_messages, :lock_version + end +end diff --git a/db/migrate/20101118104211_add_lock_version_to_event.rb b/db/migrate/20101118104211_add_lock_version_to_event.rb new file mode 100644 index 0000000..eb18998 --- /dev/null +++ b/db/migrate/20101118104211_add_lock_version_to_event.rb @@ -0,0 +1,27 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class AddLockVersionToEvent < ActiveRecord::Migration + def self.up + add_column :events, :lock_version, :integer, :default => 0 + end + + def self.down + remove_column :events, :lock_version + end +end diff --git a/db/migrate/20101119114524_add_removed_to_messages.rb b/db/migrate/20101119114524_add_removed_to_messages.rb new file mode 100644 index 0000000..006ae5f --- /dev/null +++ b/db/migrate/20101119114524_add_removed_to_messages.rb @@ -0,0 +1,27 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class AddRemovedToMessages < ActiveRecord::Migration + def self.up + add_column :messages, :removed, :boolean, :default => false + end + + def self.down + remove_column :messages, :removed + end +end diff --git a/db/migrate/20101119114704_add_events_to_ressources.rb b/db/migrate/20101119114704_add_events_to_ressources.rb new file mode 100644 index 0000000..87629b5 --- /dev/null +++ b/db/migrate/20101119114704_add_events_to_ressources.rb @@ -0,0 +1,27 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class AddEventsToRessources < ActiveRecord::Migration + def self.up + add_column :ressources, :events, :boolean, :default => true + end + + def self.down + remove_column :ressources, :events + end +end diff --git a/db/migrate/20101220150806_add_community_selfrouting_to_participants.rb b/db/migrate/20101220150806_add_community_selfrouting_to_participants.rb new file mode 100644 index 0000000..53ec402 --- /dev/null +++ b/db/migrate/20101220150806_add_community_selfrouting_to_participants.rb @@ -0,0 +1,27 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class AddCommunitySelfroutingToParticipants < ActiveRecord::Migration + def self.up + add_column :participants, :community_selfrouting, :boolean, :default => false + end + + def self.down + remove_column :participants, :community_selfrouting + end +end diff --git a/db/migrate/20101223102836_create_community_messages.rb b/db/migrate/20101223102836_create_community_messages.rb new file mode 100644 index 0000000..9b3326a --- /dev/null +++ b/db/migrate/20101223102836_create_community_messages.rb @@ -0,0 +1,32 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class CreateCommunityMessages < ActiveRecord::Migration + def self.up + create_table :community_messages do |t| + t.integer :community_id + t.integer :message_id + + t.timestamps + end + end + + def self.down + drop_table :community_messages + end +end diff --git a/db/migrate/20110103143940_remove_xecsreceivercommunities_from_message.rb b/db/migrate/20110103143940_remove_xecsreceivercommunities_from_message.rb new file mode 100644 index 0000000..5144181 --- /dev/null +++ b/db/migrate/20110103143940_remove_xecsreceivercommunities_from_message.rb @@ -0,0 +1,27 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class RemoveXecsreceivercommunitiesFromMessage < ActiveRecord::Migration + def self.up + remove_column :messages, :x_ecs_receiver_communities + end + + def self.down + add_column :messages, :x_ecs_receiver_communities + end +end diff --git a/db/migrate/20110103145840_remove_xecsreceivermemberships_from_message.rb b/db/migrate/20110103145840_remove_xecsreceivermemberships_from_message.rb new file mode 100644 index 0000000..e31b347 --- /dev/null +++ b/db/migrate/20110103145840_remove_xecsreceivermemberships_from_message.rb @@ -0,0 +1,27 @@ +# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + + +class RemoveXecsreceivermembershipsFromMessage < ActiveRecord::Migration + def self.up + remove_column :messages, :x_ecs_receiver_memberships + end + + def self.down + add_column :messages, :x_ecs_receiver_memberships + end +end diff --git a/db/migrate/20110303145153_create_auths.rb b/db/migrate/20110303145153_create_auths.rb new file mode 100644 index 0000000..ba3a8fb --- /dev/null +++ b/db/migrate/20110303145153_create_auths.rb @@ -0,0 +1,14 @@ +class CreateAuths < ActiveRecord::Migration + def self.up + create_table :auths do |t| + t.string :one_touch_hash + t.integer :message_id + + t.timestamps + end + end + + def self.down + drop_table :auths + end +end diff --git a/db/migrate/20130813144307_add_events_to_participant.rb b/db/migrate/20130813144307_add_events_to_participant.rb new file mode 100644 index 0000000..a1dd85f --- /dev/null +++ b/db/migrate/20130813144307_add_events_to_participant.rb @@ -0,0 +1,13 @@ +class AddEventsToParticipant < ActiveRecord::Migration + def self.up + add_column :participants, :events_, :boolean, :default => true + Participant.all.each do |p| + p.events_= ECS_CONFIG["participants"]["allow_events"] + p.save! + end + end + + def self.down + remove_column :participants, :events_ + end +end diff --git a/db/migrate/20140525164346_create_subparticipants.rb b/db/migrate/20140525164346_create_subparticipants.rb new file mode 100644 index 0000000..6e2e49d --- /dev/null +++ b/db/migrate/20140525164346_create_subparticipants.rb @@ -0,0 +1,32 @@ +# Copyright (C) 2014 Heiko Bernloehr (FreeIT.de). +# +# This file is part of ECS. +# +# ECS is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# ECS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public +# License along with ECS. If not, see <http://www.gnu.org/licenses/>. + +class CreateSubparticipants < ActiveRecord::Migration + def self.up + create_table :subparticipants do |t| + t.integer :participant_id + t.integer :parent_id + t.string :realm + + t.timestamps + end + end + + def self.down + drop_table :subparticipants + end +end diff --git a/db/migrate/20150420210728_add_ptype_to_participants.rb b/db/migrate/20150420210728_add_ptype_to_participants.rb new file mode 100644 index 0000000..679321a --- /dev/null +++ b/db/migrate/20150420210728_add_ptype_to_participants.rb @@ -0,0 +1,23 @@ +class AddPtypeToParticipants < ActiveRecord::Migration + def self.up + add_column :participants, :ptype, :string + assign_participant_type + end + + def self.down + remove_column :participants, :ptype + end + +private + + def self.assign_participant_type + Participant.all.each do |p| + case + when p.mainparticipant? then p.ptype= Participant::TYPE[:main] + when p.subparticipant? then p.ptype= Participant::TYPE[:sub] + when p.anonymousparticipant? then p.ptype= Participant::TYPE[:anonym] + end + p.save! + end + end +end |