Fix sqlite3 regression
[ecs.git] / db / seeds.rb
blob714923f2deb5cfe2d4cbb0f1f41456024e59dd29
1 # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2015
2 # Heiko Bernloehr (FreeIT.de).
4 # This file is part of ECS.
6 # ECS is free software: you can redistribute it and/or modify it
7 # under the terms of the GNU Affero General Public License as
8 # published by the Free Software Foundation, either version 3 of
9 # the License, or (at your option) any later version.
11 # ECS is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public
17 # License along with ECS. If not, see <http://www.gnu.org/licenses/>.
19 Organization.create :name => "not available",
20   :description => "For anonymous participants.",
21   :abrev => "n/a" if Organization.find_by_name("not available").nil?
22 Organization.create :name => "system",
23   :description => "Internal ECS community.",
24   :abrev => "sys" if Organization.find_by_name("system").nil?
25 Participant.create :name => "ecs",
26   :description => "ECS system participant",
27   :dns => 'n/a',
28   :community_selfrouting => false,
29   :organization_id => Organization.find_by_name("system").id if Participant.find_by_name("ecs").nil?
30 Community.create :name => "public",
31   :description => "For anonymous participants." if Community.find_by_name("public").nil?
32 %w(created destroyed updated notlinked).each do |evt|
33   EvType.create :name => evt if EvType.find_by_name(evt).nil?
34 end
35 Ressource.create :namespace => 'sys',
36   :ressource => 'auths',
37   :postroute => false,
38   :events => false if Ressource.find_by_namespace_and_ressource("sys","auths").nil?