##// END OF EJS Templates
indexes added...
Jean-Philippe Lang -
r23:fbafa9579127
parent child
Show More
@@ -1,309 +1,317
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class Setup < ActiveRecord::Migration
18 class Setup < ActiveRecord::Migration
19 def self.up
19 def self.up
20 create_table "attachments", :force => true do |t|
20 create_table "attachments", :force => true do |t|
21 t.column "container_id", :integer, :default => 0, :null => false
21 t.column "container_id", :integer, :default => 0, :null => false
22 t.column "container_type", :string, :limit => 30, :default => "", :null => false
22 t.column "container_type", :string, :limit => 30, :default => "", :null => false
23 t.column "filename", :string, :default => "", :null => false
23 t.column "filename", :string, :default => "", :null => false
24 t.column "disk_filename", :string, :default => "", :null => false
24 t.column "disk_filename", :string, :default => "", :null => false
25 t.column "filesize", :integer, :default => 0, :null => false
25 t.column "filesize", :integer, :default => 0, :null => false
26 t.column "content_type", :string, :limit => 60, :default => ""
26 t.column "content_type", :string, :limit => 60, :default => ""
27 t.column "digest", :string, :limit => 40, :default => "", :null => false
27 t.column "digest", :string, :limit => 40, :default => "", :null => false
28 t.column "downloads", :integer, :default => 0, :null => false
28 t.column "downloads", :integer, :default => 0, :null => false
29 t.column "author_id", :integer, :default => 0, :null => false
29 t.column "author_id", :integer, :default => 0, :null => false
30 t.column "created_on", :timestamp
30 t.column "created_on", :timestamp
31 end
31 end
32
32
33 create_table "auth_sources", :force => true do |t|
33 create_table "auth_sources", :force => true do |t|
34 t.column "type", :string, :limit => 30, :default => "", :null => false
34 t.column "type", :string, :limit => 30, :default => "", :null => false
35 t.column "name", :string, :limit => 60, :default => "", :null => false
35 t.column "name", :string, :limit => 60, :default => "", :null => false
36 t.column "host", :string, :limit => 60
36 t.column "host", :string, :limit => 60
37 t.column "port", :integer
37 t.column "port", :integer
38 t.column "account", :string, :limit => 60
38 t.column "account", :string, :limit => 60
39 t.column "account_password", :string, :limit => 60
39 t.column "account_password", :string, :limit => 60
40 t.column "base_dn", :string, :limit => 255
40 t.column "base_dn", :string, :limit => 255
41 t.column "attr_login", :string, :limit => 30
41 t.column "attr_login", :string, :limit => 30
42 t.column "attr_firstname", :string, :limit => 30
42 t.column "attr_firstname", :string, :limit => 30
43 t.column "attr_lastname", :string, :limit => 30
43 t.column "attr_lastname", :string, :limit => 30
44 t.column "attr_mail", :string, :limit => 30
44 t.column "attr_mail", :string, :limit => 30
45 t.column "onthefly_register", :boolean, :default => false, :null => false
45 t.column "onthefly_register", :boolean, :default => false, :null => false
46 end
46 end
47
47
48 create_table "custom_fields", :force => true do |t|
48 create_table "custom_fields", :force => true do |t|
49 t.column "type", :string, :limit => 30, :default => "", :null => false
49 t.column "type", :string, :limit => 30, :default => "", :null => false
50 t.column "name", :string, :limit => 30, :default => "", :null => false
50 t.column "name", :string, :limit => 30, :default => "", :null => false
51 t.column "field_format", :string, :limit => 30, :default => "", :null => false
51 t.column "field_format", :string, :limit => 30, :default => "", :null => false
52 t.column "possible_values", :text, :default => ""
52 t.column "possible_values", :text, :default => ""
53 t.column "regexp", :string, :default => ""
53 t.column "regexp", :string, :default => ""
54 t.column "min_length", :integer, :default => 0, :null => false
54 t.column "min_length", :integer, :default => 0, :null => false
55 t.column "max_length", :integer, :default => 0, :null => false
55 t.column "max_length", :integer, :default => 0, :null => false
56 t.column "is_required", :boolean, :default => false, :null => false
56 t.column "is_required", :boolean, :default => false, :null => false
57 t.column "is_for_all", :boolean, :default => false, :null => false
57 t.column "is_for_all", :boolean, :default => false, :null => false
58 end
58 end
59
59
60 create_table "custom_fields_projects", :id => false, :force => true do |t|
60 create_table "custom_fields_projects", :id => false, :force => true do |t|
61 t.column "custom_field_id", :integer, :default => 0, :null => false
61 t.column "custom_field_id", :integer, :default => 0, :null => false
62 t.column "project_id", :integer, :default => 0, :null => false
62 t.column "project_id", :integer, :default => 0, :null => false
63 end
63 end
64
64
65 create_table "custom_fields_trackers", :id => false, :force => true do |t|
65 create_table "custom_fields_trackers", :id => false, :force => true do |t|
66 t.column "custom_field_id", :integer, :default => 0, :null => false
66 t.column "custom_field_id", :integer, :default => 0, :null => false
67 t.column "tracker_id", :integer, :default => 0, :null => false
67 t.column "tracker_id", :integer, :default => 0, :null => false
68 end
68 end
69
69
70 create_table "custom_values", :force => true do |t|
70 create_table "custom_values", :force => true do |t|
71 t.column "customized_type", :string, :limit => 30, :default => "", :null => false
71 t.column "customized_type", :string, :limit => 30, :default => "", :null => false
72 t.column "customized_id", :integer, :default => 0, :null => false
72 t.column "customized_id", :integer, :default => 0, :null => false
73 t.column "custom_field_id", :integer, :default => 0, :null => false
73 t.column "custom_field_id", :integer, :default => 0, :null => false
74 t.column "value", :text, :default => "", :null => false
74 t.column "value", :text, :default => "", :null => false
75 end
75 end
76
76
77 create_table "documents", :force => true do |t|
77 create_table "documents", :force => true do |t|
78 t.column "project_id", :integer, :default => 0, :null => false
78 t.column "project_id", :integer, :default => 0, :null => false
79 t.column "category_id", :integer, :default => 0, :null => false
79 t.column "category_id", :integer, :default => 0, :null => false
80 t.column "title", :string, :limit => 60, :default => "", :null => false
80 t.column "title", :string, :limit => 60, :default => "", :null => false
81 t.column "description", :text, :default => ""
81 t.column "description", :text, :default => ""
82 t.column "created_on", :timestamp
82 t.column "created_on", :timestamp
83 end
83 end
84
84
85 add_index "documents", ["project_id"], :name => "documents_project_id"
86
85 create_table "enumerations", :force => true do |t|
87 create_table "enumerations", :force => true do |t|
86 t.column "opt", :string, :limit => 4, :default => "", :null => false
88 t.column "opt", :string, :limit => 4, :default => "", :null => false
87 t.column "name", :string, :limit => 30, :default => "", :null => false
89 t.column "name", :string, :limit => 30, :default => "", :null => false
88 end
90 end
89
91
90 create_table "issue_categories", :force => true do |t|
92 create_table "issue_categories", :force => true do |t|
91 t.column "project_id", :integer, :default => 0, :null => false
93 t.column "project_id", :integer, :default => 0, :null => false
92 t.column "name", :string, :limit => 30, :default => "", :null => false
94 t.column "name", :string, :limit => 30, :default => "", :null => false
93 end
95 end
94
96
97 add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
98
95 create_table "issue_histories", :force => true do |t|
99 create_table "issue_histories", :force => true do |t|
96 t.column "issue_id", :integer, :default => 0, :null => false
100 t.column "issue_id", :integer, :default => 0, :null => false
97 t.column "status_id", :integer, :default => 0, :null => false
101 t.column "status_id", :integer, :default => 0, :null => false
98 t.column "author_id", :integer, :default => 0, :null => false
102 t.column "author_id", :integer, :default => 0, :null => false
99 t.column "notes", :text, :default => ""
103 t.column "notes", :text, :default => ""
100 t.column "created_on", :timestamp
104 t.column "created_on", :timestamp
101 end
105 end
102
106
103 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
107 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
104
108
105 create_table "issue_statuses", :force => true do |t|
109 create_table "issue_statuses", :force => true do |t|
106 t.column "name", :string, :limit => 30, :default => "", :null => false
110 t.column "name", :string, :limit => 30, :default => "", :null => false
107 t.column "is_closed", :boolean, :default => false, :null => false
111 t.column "is_closed", :boolean, :default => false, :null => false
108 t.column "is_default", :boolean, :default => false, :null => false
112 t.column "is_default", :boolean, :default => false, :null => false
109 t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false
113 t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false
110 end
114 end
111
115
112 create_table "issues", :force => true do |t|
116 create_table "issues", :force => true do |t|
113 t.column "tracker_id", :integer, :default => 0, :null => false
117 t.column "tracker_id", :integer, :default => 0, :null => false
114 t.column "project_id", :integer, :default => 0, :null => false
118 t.column "project_id", :integer, :default => 0, :null => false
115 t.column "subject", :string, :default => "", :null => false
119 t.column "subject", :string, :default => "", :null => false
116 t.column "description", :text, :default => "", :null => false
120 t.column "description", :text, :default => "", :null => false
117 t.column "due_date", :date
121 t.column "due_date", :date
118 t.column "category_id", :integer
122 t.column "category_id", :integer
119 t.column "status_id", :integer, :default => 0, :null => false
123 t.column "status_id", :integer, :default => 0, :null => false
120 t.column "assigned_to_id", :integer
124 t.column "assigned_to_id", :integer
121 t.column "priority_id", :integer, :default => 0, :null => false
125 t.column "priority_id", :integer, :default => 0, :null => false
122 t.column "fixed_version_id", :integer
126 t.column "fixed_version_id", :integer
123 t.column "author_id", :integer, :default => 0, :null => false
127 t.column "author_id", :integer, :default => 0, :null => false
124 t.column "lock_version", :integer, :default => 0, :null => false
128 t.column "lock_version", :integer, :default => 0, :null => false
125 t.column "created_on", :timestamp
129 t.column "created_on", :timestamp
126 t.column "updated_on", :timestamp
130 t.column "updated_on", :timestamp
127 end
131 end
128
132
129 add_index "issues", ["project_id"], :name => "issues_project_id"
133 add_index "issues", ["project_id"], :name => "issues_project_id"
130
134
131 create_table "members", :force => true do |t|
135 create_table "members", :force => true do |t|
132 t.column "user_id", :integer, :default => 0, :null => false
136 t.column "user_id", :integer, :default => 0, :null => false
133 t.column "project_id", :integer, :default => 0, :null => false
137 t.column "project_id", :integer, :default => 0, :null => false
134 t.column "role_id", :integer, :default => 0, :null => false
138 t.column "role_id", :integer, :default => 0, :null => false
135 t.column "created_on", :timestamp
139 t.column "created_on", :timestamp
136 end
140 end
137
141
138 create_table "news", :force => true do |t|
142 create_table "news", :force => true do |t|
139 t.column "project_id", :integer
143 t.column "project_id", :integer
140 t.column "title", :string, :limit => 60, :default => "", :null => false
144 t.column "title", :string, :limit => 60, :default => "", :null => false
141 t.column "summary", :string, :limit => 255, :default => ""
145 t.column "summary", :string, :limit => 255, :default => ""
142 t.column "description", :text, :default => "", :null => false
146 t.column "description", :text, :default => "", :null => false
143 t.column "author_id", :integer, :default => 0, :null => false
147 t.column "author_id", :integer, :default => 0, :null => false
144 t.column "created_on", :timestamp
148 t.column "created_on", :timestamp
145 end
149 end
146
150
151 add_index "news", ["project_id"], :name => "news_project_id"
152
147 create_table "permissions", :force => true do |t|
153 create_table "permissions", :force => true do |t|
148 t.column "controller", :string, :limit => 30, :default => "", :null => false
154 t.column "controller", :string, :limit => 30, :default => "", :null => false
149 t.column "action", :string, :limit => 30, :default => "", :null => false
155 t.column "action", :string, :limit => 30, :default => "", :null => false
150 t.column "description", :string, :limit => 60, :default => "", :null => false
156 t.column "description", :string, :limit => 60, :default => "", :null => false
151 t.column "is_public", :boolean, :default => false, :null => false
157 t.column "is_public", :boolean, :default => false, :null => false
152 t.column "sort", :integer, :default => 0, :null => false
158 t.column "sort", :integer, :default => 0, :null => false
153 t.column "mail_option", :boolean, :default => false, :null => false
159 t.column "mail_option", :boolean, :default => false, :null => false
154 t.column "mail_enabled", :boolean, :default => false, :null => false
160 t.column "mail_enabled", :boolean, :default => false, :null => false
155 end
161 end
156
162
157 create_table "permissions_roles", :id => false, :force => true do |t|
163 create_table "permissions_roles", :id => false, :force => true do |t|
158 t.column "permission_id", :integer, :default => 0, :null => false
164 t.column "permission_id", :integer, :default => 0, :null => false
159 t.column "role_id", :integer, :default => 0, :null => false
165 t.column "role_id", :integer, :default => 0, :null => false
160 end
166 end
161
167
162 add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
168 add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
163
169
164 create_table "projects", :force => true do |t|
170 create_table "projects", :force => true do |t|
165 t.column "name", :string, :limit => 30, :default => "", :null => false
171 t.column "name", :string, :limit => 30, :default => "", :null => false
166 t.column "description", :string, :default => "", :null => false
172 t.column "description", :string, :default => "", :null => false
167 t.column "homepage", :string, :limit => 60, :default => ""
173 t.column "homepage", :string, :limit => 60, :default => ""
168 t.column "is_public", :boolean, :default => true, :null => false
174 t.column "is_public", :boolean, :default => true, :null => false
169 t.column "parent_id", :integer
175 t.column "parent_id", :integer
170 t.column "projects_count", :integer, :default => 0
176 t.column "projects_count", :integer, :default => 0
171 t.column "created_on", :timestamp
177 t.column "created_on", :timestamp
172 t.column "updated_on", :timestamp
178 t.column "updated_on", :timestamp
173 end
179 end
174
180
175 create_table "roles", :force => true do |t|
181 create_table "roles", :force => true do |t|
176 t.column "name", :string, :limit => 30, :default => "", :null => false
182 t.column "name", :string, :limit => 30, :default => "", :null => false
177 end
183 end
178
184
179 create_table "tokens", :force => true do |t|
185 create_table "tokens", :force => true do |t|
180 t.column "user_id", :integer, :default => 0, :null => false
186 t.column "user_id", :integer, :default => 0, :null => false
181 t.column "action", :string, :limit => 30, :default => "", :null => false
187 t.column "action", :string, :limit => 30, :default => "", :null => false
182 t.column "value", :string, :limit => 40, :default => "", :null => false
188 t.column "value", :string, :limit => 40, :default => "", :null => false
183 t.column "created_on", :datetime, :null => false
189 t.column "created_on", :datetime, :null => false
184 end
190 end
185
191
186 create_table "trackers", :force => true do |t|
192 create_table "trackers", :force => true do |t|
187 t.column "name", :string, :limit => 30, :default => "", :null => false
193 t.column "name", :string, :limit => 30, :default => "", :null => false
188 t.column "is_in_chlog", :boolean, :default => false, :null => false
194 t.column "is_in_chlog", :boolean, :default => false, :null => false
189 end
195 end
190
196
191 create_table "users", :force => true do |t|
197 create_table "users", :force => true do |t|
192 t.column "login", :string, :limit => 30, :default => "", :null => false
198 t.column "login", :string, :limit => 30, :default => "", :null => false
193 t.column "hashed_password", :string, :limit => 40, :default => "", :null => false
199 t.column "hashed_password", :string, :limit => 40, :default => "", :null => false
194 t.column "firstname", :string, :limit => 30, :default => "", :null => false
200 t.column "firstname", :string, :limit => 30, :default => "", :null => false
195 t.column "lastname", :string, :limit => 30, :default => "", :null => false
201 t.column "lastname", :string, :limit => 30, :default => "", :null => false
196 t.column "mail", :string, :limit => 60, :default => "", :null => false
202 t.column "mail", :string, :limit => 60, :default => "", :null => false
197 t.column "mail_notification", :boolean, :default => true, :null => false
203 t.column "mail_notification", :boolean, :default => true, :null => false
198 t.column "admin", :boolean, :default => false, :null => false
204 t.column "admin", :boolean, :default => false, :null => false
199 t.column "status", :integer, :default => 1, :null => false
205 t.column "status", :integer, :default => 1, :null => false
200 t.column "last_login_on", :datetime
206 t.column "last_login_on", :datetime
201 t.column "language", :string, :limit => 2, :default => ""
207 t.column "language", :string, :limit => 2, :default => ""
202 t.column "auth_source_id", :integer
208 t.column "auth_source_id", :integer
203 t.column "created_on", :timestamp
209 t.column "created_on", :timestamp
204 t.column "updated_on", :timestamp
210 t.column "updated_on", :timestamp
205 end
211 end
206
212
207 create_table "versions", :force => true do |t|
213 create_table "versions", :force => true do |t|
208 t.column "project_id", :integer, :default => 0, :null => false
214 t.column "project_id", :integer, :default => 0, :null => false
209 t.column "name", :string, :limit => 30, :default => "", :null => false
215 t.column "name", :string, :limit => 30, :default => "", :null => false
210 t.column "description", :string, :default => ""
216 t.column "description", :string, :default => ""
211 t.column "effective_date", :date, :null => false
217 t.column "effective_date", :date, :null => false
212 t.column "created_on", :timestamp
218 t.column "created_on", :timestamp
213 t.column "updated_on", :timestamp
219 t.column "updated_on", :timestamp
214 end
220 end
215
221
222 add_index "versions", ["project_id"], :name => "versions_project_id"
223
216 create_table "workflows", :force => true do |t|
224 create_table "workflows", :force => true do |t|
217 t.column "tracker_id", :integer, :default => 0, :null => false
225 t.column "tracker_id", :integer, :default => 0, :null => false
218 t.column "old_status_id", :integer, :default => 0, :null => false
226 t.column "old_status_id", :integer, :default => 0, :null => false
219 t.column "new_status_id", :integer, :default => 0, :null => false
227 t.column "new_status_id", :integer, :default => 0, :null => false
220 t.column "role_id", :integer, :default => 0, :null => false
228 t.column "role_id", :integer, :default => 0, :null => false
221 end
229 end
222
230
223 # project
231 # project
224 Permission.create :controller => "projects", :action => "show", :description => "label_overview", :sort => 100, :is_public => true
232 Permission.create :controller => "projects", :action => "show", :description => "label_overview", :sort => 100, :is_public => true
225 Permission.create :controller => "projects", :action => "changelog", :description => "label_change_log", :sort => 105, :is_public => true
233 Permission.create :controller => "projects", :action => "changelog", :description => "label_change_log", :sort => 105, :is_public => true
226 Permission.create :controller => "reports", :action => "issue_report", :description => "label_report_plural", :sort => 110, :is_public => true
234 Permission.create :controller => "reports", :action => "issue_report", :description => "label_report_plural", :sort => 110, :is_public => true
227 Permission.create :controller => "projects", :action => "settings", :description => "label_settings", :sort => 150
235 Permission.create :controller => "projects", :action => "settings", :description => "label_settings", :sort => 150
228 Permission.create :controller => "projects", :action => "edit", :description => "button_edit", :sort => 151
236 Permission.create :controller => "projects", :action => "edit", :description => "button_edit", :sort => 151
229 # members
237 # members
230 Permission.create :controller => "projects", :action => "list_members", :description => "button_list", :sort => 200, :is_public => true
238 Permission.create :controller => "projects", :action => "list_members", :description => "button_list", :sort => 200, :is_public => true
231 Permission.create :controller => "projects", :action => "add_member", :description => "button_add", :sort => 220
239 Permission.create :controller => "projects", :action => "add_member", :description => "button_add", :sort => 220
232 Permission.create :controller => "members", :action => "edit", :description => "button_edit", :sort => 221
240 Permission.create :controller => "members", :action => "edit", :description => "button_edit", :sort => 221
233 Permission.create :controller => "members", :action => "destroy", :description => "button_delete", :sort => 222
241 Permission.create :controller => "members", :action => "destroy", :description => "button_delete", :sort => 222
234 # versions
242 # versions
235 Permission.create :controller => "projects", :action => "add_version", :description => "button_add", :sort => 320
243 Permission.create :controller => "projects", :action => "add_version", :description => "button_add", :sort => 320
236 Permission.create :controller => "versions", :action => "edit", :description => "button_edit", :sort => 321
244 Permission.create :controller => "versions", :action => "edit", :description => "button_edit", :sort => 321
237 Permission.create :controller => "versions", :action => "destroy", :description => "button_delete", :sort => 322
245 Permission.create :controller => "versions", :action => "destroy", :description => "button_delete", :sort => 322
238 # issue categories
246 # issue categories
239 Permission.create :controller => "projects", :action => "add_issue_category", :description => "button_add", :sort => 420
247 Permission.create :controller => "projects", :action => "add_issue_category", :description => "button_add", :sort => 420
240 Permission.create :controller => "issue_categories", :action => "edit", :description => "button_edit", :sort => 421
248 Permission.create :controller => "issue_categories", :action => "edit", :description => "button_edit", :sort => 421
241 Permission.create :controller => "issue_categories", :action => "destroy", :description => "button_delete", :sort => 422
249 Permission.create :controller => "issue_categories", :action => "destroy", :description => "button_delete", :sort => 422
242 # issues
250 # issues
243 Permission.create :controller => "projects", :action => "list_issues", :description => "button_list", :sort => 1000, :is_public => true
251 Permission.create :controller => "projects", :action => "list_issues", :description => "button_list", :sort => 1000, :is_public => true
244 Permission.create :controller => "projects", :action => "export_issues_csv", :description => "label_export_csv", :sort => 1001, :is_public => true
252 Permission.create :controller => "projects", :action => "export_issues_csv", :description => "label_export_csv", :sort => 1001, :is_public => true
245 Permission.create :controller => "issues", :action => "show", :description => "button_view", :sort => 1005, :is_public => true
253 Permission.create :controller => "issues", :action => "show", :description => "button_view", :sort => 1005, :is_public => true
246 Permission.create :controller => "issues", :action => "download", :description => "button_download", :sort => 1010, :is_public => true
254 Permission.create :controller => "issues", :action => "download", :description => "button_download", :sort => 1010, :is_public => true
247 Permission.create :controller => "projects", :action => "add_issue", :description => "button_add", :sort => 1050, :mail_option => 1, :mail_enabled => 1
255 Permission.create :controller => "projects", :action => "add_issue", :description => "button_add", :sort => 1050, :mail_option => 1, :mail_enabled => 1
248 Permission.create :controller => "issues", :action => "edit", :description => "button_edit", :sort => 1055
256 Permission.create :controller => "issues", :action => "edit", :description => "button_edit", :sort => 1055
249 Permission.create :controller => "issues", :action => "change_status", :description => "label_change_status", :sort => 1060, :mail_option => 1, :mail_enabled => 1
257 Permission.create :controller => "issues", :action => "change_status", :description => "label_change_status", :sort => 1060, :mail_option => 1, :mail_enabled => 1
250 Permission.create :controller => "issues", :action => "destroy", :description => "button_delete", :sort => 1065
258 Permission.create :controller => "issues", :action => "destroy", :description => "button_delete", :sort => 1065
251 Permission.create :controller => "issues", :action => "add_attachment", :description => "label_attachment_new", :sort => 1070
259 Permission.create :controller => "issues", :action => "add_attachment", :description => "label_attachment_new", :sort => 1070
252 Permission.create :controller => "issues", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1075
260 Permission.create :controller => "issues", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1075
253 # news
261 # news
254 Permission.create :controller => "projects", :action => "list_news", :description => "button_list", :sort => 1100, :is_public => true
262 Permission.create :controller => "projects", :action => "list_news", :description => "button_list", :sort => 1100, :is_public => true
255 Permission.create :controller => "news", :action => "show", :description => "button_view", :sort => 1101, :is_public => true
263 Permission.create :controller => "news", :action => "show", :description => "button_view", :sort => 1101, :is_public => true
256 Permission.create :controller => "projects", :action => "add_news", :description => "button_add", :sort => 1120
264 Permission.create :controller => "projects", :action => "add_news", :description => "button_add", :sort => 1120
257 Permission.create :controller => "news", :action => "edit", :description => "button_edit", :sort => 1121
265 Permission.create :controller => "news", :action => "edit", :description => "button_edit", :sort => 1121
258 Permission.create :controller => "news", :action => "destroy", :description => "button_delete", :sort => 1122
266 Permission.create :controller => "news", :action => "destroy", :description => "button_delete", :sort => 1122
259 # documents
267 # documents
260 Permission.create :controller => "projects", :action => "list_documents", :description => "button_list", :sort => 1200, :is_public => true
268 Permission.create :controller => "projects", :action => "list_documents", :description => "button_list", :sort => 1200, :is_public => true
261 Permission.create :controller => "documents", :action => "show", :description => "button_view", :sort => 1201, :is_public => true
269 Permission.create :controller => "documents", :action => "show", :description => "button_view", :sort => 1201, :is_public => true
262 Permission.create :controller => "documents", :action => "download", :description => "button_download", :sort => 1202, :is_public => true
270 Permission.create :controller => "documents", :action => "download", :description => "button_download", :sort => 1202, :is_public => true
263 Permission.create :controller => "projects", :action => "add_document", :description => "button_add", :sort => 1220
271 Permission.create :controller => "projects", :action => "add_document", :description => "button_add", :sort => 1220
264 Permission.create :controller => "documents", :action => "edit", :description => "button_edit", :sort => 1221
272 Permission.create :controller => "documents", :action => "edit", :description => "button_edit", :sort => 1221
265 Permission.create :controller => "documents", :action => "destroy", :description => "button_delete", :sort => 1222
273 Permission.create :controller => "documents", :action => "destroy", :description => "button_delete", :sort => 1222
266 Permission.create :controller => "documents", :action => "add_attachment", :description => "label_attachment_new", :sort => 1223
274 Permission.create :controller => "documents", :action => "add_attachment", :description => "label_attachment_new", :sort => 1223
267 Permission.create :controller => "documents", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1224
275 Permission.create :controller => "documents", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1224
268 # files
276 # files
269 Permission.create :controller => "projects", :action => "list_files", :description => "button_list", :sort => 1300, :is_public => true
277 Permission.create :controller => "projects", :action => "list_files", :description => "button_list", :sort => 1300, :is_public => true
270 Permission.create :controller => "versions", :action => "download", :description => "button_download", :sort => 1301, :is_public => true
278 Permission.create :controller => "versions", :action => "download", :description => "button_download", :sort => 1301, :is_public => true
271 Permission.create :controller => "projects", :action => "add_file", :description => "button_add", :sort => 1320
279 Permission.create :controller => "projects", :action => "add_file", :description => "button_add", :sort => 1320
272 Permission.create :controller => "versions", :action => "destroy_file", :description => "button_delete", :sort => 1322
280 Permission.create :controller => "versions", :action => "destroy_file", :description => "button_delete", :sort => 1322
273
281
274 # create default administrator account
282 # create default administrator account
275 user = User.create :firstname => "redMine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en"
283 user = User.create :firstname => "redMine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en"
276 user.login = "admin"
284 user.login = "admin"
277 user.password = "admin"
285 user.password = "admin"
278 user.admin = true
286 user.admin = true
279 user.save
287 user.save
280
288
281
289
282 end
290 end
283
291
284 def self.down
292 def self.down
285 drop_table :attachments
293 drop_table :attachments
286 drop_table :auth_sources
294 drop_table :auth_sources
287 drop_table :custom_fields
295 drop_table :custom_fields
288 drop_table :custom_fields_projects
296 drop_table :custom_fields_projects
289 drop_table :custom_fields_trackers
297 drop_table :custom_fields_trackers
290 drop_table :custom_values
298 drop_table :custom_values
291 drop_table :documents
299 drop_table :documents
292 drop_table :enumerations
300 drop_table :enumerations
293 drop_table :issue_categories
301 drop_table :issue_categories
294 drop_table :issue_histories
302 drop_table :issue_histories
295 drop_table :issue_statuses
303 drop_table :issue_statuses
296 drop_table :issues
304 drop_table :issues
297 drop_table :members
305 drop_table :members
298 drop_table :news
306 drop_table :news
299 drop_table :permissions
307 drop_table :permissions
300 drop_table :permissions_roles
308 drop_table :permissions_roles
301 drop_table :projects
309 drop_table :projects
302 drop_table :roles
310 drop_table :roles
303 drop_table :trackers
311 drop_table :trackers
304 drop_table :tokens
312 drop_table :tokens
305 drop_table :users
313 drop_table :users
306 drop_table :versions
314 drop_table :versions
307 drop_table :workflows
315 drop_table :workflows
308 end
316 end
309 end
317 end
General Comments 0
You need to be logged in to leave comments. Login now