@@ -1,329 +1,329 | |||||
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 |
|
19 | |||
20 | class User < ActiveRecord::Base |
|
20 | class User < ActiveRecord::Base | |
21 | attr_protected :id |
|
21 | attr_protected :id | |
22 | end |
|
22 | end | |
23 |
|
23 | |||
24 | # model removed |
|
24 | # model removed | |
25 | class Permission < ActiveRecord::Base; end |
|
25 | class Permission < ActiveRecord::Base; end | |
26 |
|
26 | |||
27 | def self.up |
|
27 | def self.up | |
28 | create_table "attachments", :force => true do |t| |
|
28 | create_table "attachments", :force => true do |t| | |
29 | t.column "container_id", :integer, :default => 0, :null => false |
|
29 | t.column "container_id", :integer, :default => 0, :null => false | |
30 | t.column "container_type", :string, :limit => 30, :default => "", :null => false |
|
30 | t.column "container_type", :string, :limit => 30, :default => "", :null => false | |
31 | t.column "filename", :string, :default => "", :null => false |
|
31 | t.column "filename", :string, :default => "", :null => false | |
32 | t.column "disk_filename", :string, :default => "", :null => false |
|
32 | t.column "disk_filename", :string, :default => "", :null => false | |
33 | t.column "filesize", :integer, :default => 0, :null => false |
|
33 | t.column "filesize", :integer, :default => 0, :null => false | |
34 | t.column "content_type", :string, :limit => 60, :default => "" |
|
34 | t.column "content_type", :string, :limit => 60, :default => "" | |
35 | t.column "digest", :string, :limit => 40, :default => "", :null => false |
|
35 | t.column "digest", :string, :limit => 40, :default => "", :null => false | |
36 | t.column "downloads", :integer, :default => 0, :null => false |
|
36 | t.column "downloads", :integer, :default => 0, :null => false | |
37 | t.column "author_id", :integer, :default => 0, :null => false |
|
37 | t.column "author_id", :integer, :default => 0, :null => false | |
38 | t.column "created_on", :timestamp |
|
38 | t.column "created_on", :timestamp | |
39 | end |
|
39 | end | |
40 |
|
40 | |||
41 | create_table "auth_sources", :force => true do |t| |
|
41 | create_table "auth_sources", :force => true do |t| | |
42 | t.column "type", :string, :limit => 30, :default => "", :null => false |
|
42 | t.column "type", :string, :limit => 30, :default => "", :null => false | |
43 | t.column "name", :string, :limit => 60, :default => "", :null => false |
|
43 | t.column "name", :string, :limit => 60, :default => "", :null => false | |
44 | t.column "host", :string, :limit => 60 |
|
44 | t.column "host", :string, :limit => 60 | |
45 | t.column "port", :integer |
|
45 | t.column "port", :integer | |
46 | t.column "account", :string, :limit => 60 |
|
46 | t.column "account", :string, :limit => 60 | |
47 | t.column "account_password", :string, :limit => 60 |
|
47 | t.column "account_password", :string, :limit => 60 | |
48 | t.column "base_dn", :string, :limit => 255 |
|
48 | t.column "base_dn", :string, :limit => 255 | |
49 | t.column "attr_login", :string, :limit => 30 |
|
49 | t.column "attr_login", :string, :limit => 30 | |
50 | t.column "attr_firstname", :string, :limit => 30 |
|
50 | t.column "attr_firstname", :string, :limit => 30 | |
51 | t.column "attr_lastname", :string, :limit => 30 |
|
51 | t.column "attr_lastname", :string, :limit => 30 | |
52 | t.column "attr_mail", :string, :limit => 30 |
|
52 | t.column "attr_mail", :string, :limit => 30 | |
53 | t.column "onthefly_register", :boolean, :default => false, :null => false |
|
53 | t.column "onthefly_register", :boolean, :default => false, :null => false | |
54 | end |
|
54 | end | |
55 |
|
55 | |||
56 | create_table "custom_fields", :force => true do |t| |
|
56 | create_table "custom_fields", :force => true do |t| | |
57 | t.column "type", :string, :limit => 30, :default => "", :null => false |
|
57 | t.column "type", :string, :limit => 30, :default => "", :null => false | |
58 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
58 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
59 | t.column "field_format", :string, :limit => 30, :default => "", :null => false |
|
59 | t.column "field_format", :string, :limit => 30, :default => "", :null => false | |
60 | t.column "possible_values", :text |
|
60 | t.column "possible_values", :text | |
61 | t.column "regexp", :string, :default => "" |
|
61 | t.column "regexp", :string, :default => "" | |
62 | t.column "min_length", :integer, :default => 0, :null => false |
|
62 | t.column "min_length", :integer, :default => 0, :null => false | |
63 | t.column "max_length", :integer, :default => 0, :null => false |
|
63 | t.column "max_length", :integer, :default => 0, :null => false | |
64 | t.column "is_required", :boolean, :default => false, :null => false |
|
64 | t.column "is_required", :boolean, :default => false, :null => false | |
65 | t.column "is_for_all", :boolean, :default => false, :null => false |
|
65 | t.column "is_for_all", :boolean, :default => false, :null => false | |
66 | end |
|
66 | end | |
67 |
|
67 | |||
68 | create_table "custom_fields_projects", :id => false, :force => true do |t| |
|
68 | create_table "custom_fields_projects", :id => false, :force => true do |t| | |
69 | t.column "custom_field_id", :integer, :default => 0, :null => false |
|
69 | t.column "custom_field_id", :integer, :default => 0, :null => false | |
70 | t.column "project_id", :integer, :default => 0, :null => false |
|
70 | t.column "project_id", :integer, :default => 0, :null => false | |
71 | end |
|
71 | end | |
72 |
|
72 | |||
73 | create_table "custom_fields_trackers", :id => false, :force => true do |t| |
|
73 | create_table "custom_fields_trackers", :id => false, :force => true do |t| | |
74 | t.column "custom_field_id", :integer, :default => 0, :null => false |
|
74 | t.column "custom_field_id", :integer, :default => 0, :null => false | |
75 | t.column "tracker_id", :integer, :default => 0, :null => false |
|
75 | t.column "tracker_id", :integer, :default => 0, :null => false | |
76 | end |
|
76 | end | |
77 |
|
77 | |||
78 | create_table "custom_values", :force => true do |t| |
|
78 | create_table "custom_values", :force => true do |t| | |
79 | t.column "customized_type", :string, :limit => 30, :default => "", :null => false |
|
79 | t.column "customized_type", :string, :limit => 30, :default => "", :null => false | |
80 | t.column "customized_id", :integer, :default => 0, :null => false |
|
80 | t.column "customized_id", :integer, :default => 0, :null => false | |
81 | t.column "custom_field_id", :integer, :default => 0, :null => false |
|
81 | t.column "custom_field_id", :integer, :default => 0, :null => false | |
82 | t.column "value", :text |
|
82 | t.column "value", :text | |
83 | end |
|
83 | end | |
84 |
|
84 | |||
85 | create_table "documents", :force => true do |t| |
|
85 | create_table "documents", :force => true do |t| | |
86 | t.column "project_id", :integer, :default => 0, :null => false |
|
86 | t.column "project_id", :integer, :default => 0, :null => false | |
87 | t.column "category_id", :integer, :default => 0, :null => false |
|
87 | t.column "category_id", :integer, :default => 0, :null => false | |
88 | t.column "title", :string, :limit => 60, :default => "", :null => false |
|
88 | t.column "title", :string, :limit => 60, :default => "", :null => false | |
89 | t.column "description", :text |
|
89 | t.column "description", :text | |
90 | t.column "created_on", :timestamp |
|
90 | t.column "created_on", :timestamp | |
91 | end |
|
91 | end | |
92 |
|
92 | |||
93 | add_index "documents", ["project_id"], :name => "documents_project_id" |
|
93 | add_index "documents", ["project_id"], :name => "documents_project_id" | |
94 |
|
94 | |||
95 | create_table "enumerations", :force => true do |t| |
|
95 | create_table "enumerations", :force => true do |t| | |
96 | t.column "opt", :string, :limit => 4, :default => "", :null => false |
|
96 | t.column "opt", :string, :limit => 4, :default => "", :null => false | |
97 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
97 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
98 | end |
|
98 | end | |
99 |
|
99 | |||
100 | create_table "issue_categories", :force => true do |t| |
|
100 | create_table "issue_categories", :force => true do |t| | |
101 | t.column "project_id", :integer, :default => 0, :null => false |
|
101 | t.column "project_id", :integer, :default => 0, :null => false | |
102 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
102 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
103 | end |
|
103 | end | |
104 |
|
104 | |||
105 | add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" |
|
105 | add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id" | |
106 |
|
106 | |||
107 | create_table "issue_histories", :force => true do |t| |
|
107 | create_table "issue_histories", :force => true do |t| | |
108 | t.column "issue_id", :integer, :default => 0, :null => false |
|
108 | t.column "issue_id", :integer, :default => 0, :null => false | |
109 | t.column "status_id", :integer, :default => 0, :null => false |
|
109 | t.column "status_id", :integer, :default => 0, :null => false | |
110 | t.column "author_id", :integer, :default => 0, :null => false |
|
110 | t.column "author_id", :integer, :default => 0, :null => false | |
111 | t.column "notes", :text |
|
111 | t.column "notes", :text | |
112 | t.column "created_on", :timestamp |
|
112 | t.column "created_on", :timestamp | |
113 | end |
|
113 | end | |
114 |
|
114 | |||
115 | add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id" |
|
115 | add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id" | |
116 |
|
116 | |||
117 | create_table "issue_statuses", :force => true do |t| |
|
117 | create_table "issue_statuses", :force => true do |t| | |
118 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
118 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
119 | t.column "is_closed", :boolean, :default => false, :null => false |
|
119 | t.column "is_closed", :boolean, :default => false, :null => false | |
120 | t.column "is_default", :boolean, :default => false, :null => false |
|
120 | t.column "is_default", :boolean, :default => false, :null => false | |
121 | t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false |
|
121 | t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false | |
122 | end |
|
122 | end | |
123 |
|
123 | |||
124 | create_table "issues", :force => true do |t| |
|
124 | create_table "issues", :force => true do |t| | |
125 | t.column "tracker_id", :integer, :default => 0, :null => false |
|
125 | t.column "tracker_id", :integer, :default => 0, :null => false | |
126 | t.column "project_id", :integer, :default => 0, :null => false |
|
126 | t.column "project_id", :integer, :default => 0, :null => false | |
127 | t.column "subject", :string, :default => "", :null => false |
|
127 | t.column "subject", :string, :default => "", :null => false | |
128 | t.column "description", :text |
|
128 | t.column "description", :text | |
129 | t.column "due_date", :date |
|
129 | t.column "due_date", :date | |
130 | t.column "category_id", :integer |
|
130 | t.column "category_id", :integer | |
131 | t.column "status_id", :integer, :default => 0, :null => false |
|
131 | t.column "status_id", :integer, :default => 0, :null => false | |
132 | t.column "assigned_to_id", :integer |
|
132 | t.column "assigned_to_id", :integer | |
133 | t.column "priority_id", :integer, :default => 0, :null => false |
|
133 | t.column "priority_id", :integer, :default => 0, :null => false | |
134 | t.column "fixed_version_id", :integer |
|
134 | t.column "fixed_version_id", :integer | |
135 | t.column "author_id", :integer, :default => 0, :null => false |
|
135 | t.column "author_id", :integer, :default => 0, :null => false | |
136 | t.column "lock_version", :integer, :default => 0, :null => false |
|
136 | t.column "lock_version", :integer, :default => 0, :null => false | |
137 | t.column "created_on", :timestamp |
|
137 | t.column "created_on", :timestamp | |
138 | t.column "updated_on", :timestamp |
|
138 | t.column "updated_on", :timestamp | |
139 | end |
|
139 | end | |
140 |
|
140 | |||
141 | add_index "issues", ["project_id"], :name => "issues_project_id" |
|
141 | add_index "issues", ["project_id"], :name => "issues_project_id" | |
142 |
|
142 | |||
143 | create_table "members", :force => true do |t| |
|
143 | create_table "members", :force => true do |t| | |
144 | t.column "user_id", :integer, :default => 0, :null => false |
|
144 | t.column "user_id", :integer, :default => 0, :null => false | |
145 | t.column "project_id", :integer, :default => 0, :null => false |
|
145 | t.column "project_id", :integer, :default => 0, :null => false | |
146 | t.column "role_id", :integer, :default => 0, :null => false |
|
146 | t.column "role_id", :integer, :default => 0, :null => false | |
147 | t.column "created_on", :timestamp |
|
147 | t.column "created_on", :timestamp | |
148 | end |
|
148 | end | |
149 |
|
149 | |||
150 | create_table "news", :force => true do |t| |
|
150 | create_table "news", :force => true do |t| | |
151 | t.column "project_id", :integer |
|
151 | t.column "project_id", :integer | |
152 | t.column "title", :string, :limit => 60, :default => "", :null => false |
|
152 | t.column "title", :string, :limit => 60, :default => "", :null => false | |
153 | t.column "summary", :string, :limit => 255, :default => "" |
|
153 | t.column "summary", :string, :limit => 255, :default => "" | |
154 | t.column "description", :text |
|
154 | t.column "description", :text | |
155 | t.column "author_id", :integer, :default => 0, :null => false |
|
155 | t.column "author_id", :integer, :default => 0, :null => false | |
156 | t.column "created_on", :timestamp |
|
156 | t.column "created_on", :timestamp | |
157 | end |
|
157 | end | |
158 |
|
158 | |||
159 | add_index "news", ["project_id"], :name => "news_project_id" |
|
159 | add_index "news", ["project_id"], :name => "news_project_id" | |
160 |
|
160 | |||
161 | create_table "permissions", :force => true do |t| |
|
161 | create_table "permissions", :force => true do |t| | |
162 | t.column "controller", :string, :limit => 30, :default => "", :null => false |
|
162 | t.column "controller", :string, :limit => 30, :default => "", :null => false | |
163 | t.column "action", :string, :limit => 30, :default => "", :null => false |
|
163 | t.column "action", :string, :limit => 30, :default => "", :null => false | |
164 | t.column "description", :string, :limit => 60, :default => "", :null => false |
|
164 | t.column "description", :string, :limit => 60, :default => "", :null => false | |
165 | t.column "is_public", :boolean, :default => false, :null => false |
|
165 | t.column "is_public", :boolean, :default => false, :null => false | |
166 | t.column "sort", :integer, :default => 0, :null => false |
|
166 | t.column "sort", :integer, :default => 0, :null => false | |
167 | t.column "mail_option", :boolean, :default => false, :null => false |
|
167 | t.column "mail_option", :boolean, :default => false, :null => false | |
168 | t.column "mail_enabled", :boolean, :default => false, :null => false |
|
168 | t.column "mail_enabled", :boolean, :default => false, :null => false | |
169 | end |
|
169 | end | |
170 |
|
170 | |||
171 | create_table "permissions_roles", :id => false, :force => true do |t| |
|
171 | create_table "permissions_roles", :id => false, :force => true do |t| | |
172 | t.column "permission_id", :integer, :default => 0, :null => false |
|
172 | t.column "permission_id", :integer, :default => 0, :null => false | |
173 | t.column "role_id", :integer, :default => 0, :null => false |
|
173 | t.column "role_id", :integer, :default => 0, :null => false | |
174 | end |
|
174 | end | |
175 |
|
175 | |||
176 | add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" |
|
176 | add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" | |
177 |
|
177 | |||
178 | create_table "projects", :force => true do |t| |
|
178 | create_table "projects", :force => true do |t| | |
179 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
179 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
180 | t.column "description", :string, :default => "", :null => false |
|
180 | t.column "description", :string, :default => "", :null => false | |
181 | t.column "homepage", :string, :limit => 60, :default => "" |
|
181 | t.column "homepage", :string, :limit => 60, :default => "" | |
182 | t.column "is_public", :boolean, :default => true, :null => false |
|
182 | t.column "is_public", :boolean, :default => true, :null => false | |
183 | t.column "parent_id", :integer |
|
183 | t.column "parent_id", :integer | |
184 | t.column "projects_count", :integer, :default => 0 |
|
184 | t.column "projects_count", :integer, :default => 0 | |
185 | t.column "created_on", :timestamp |
|
185 | t.column "created_on", :timestamp | |
186 | t.column "updated_on", :timestamp |
|
186 | t.column "updated_on", :timestamp | |
187 | end |
|
187 | end | |
188 |
|
188 | |||
189 | create_table "roles", :force => true do |t| |
|
189 | create_table "roles", :force => true do |t| | |
190 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
190 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
191 | end |
|
191 | end | |
192 |
|
192 | |||
193 | create_table "tokens", :force => true do |t| |
|
193 | create_table "tokens", :force => true do |t| | |
194 | t.column "user_id", :integer, :default => 0, :null => false |
|
194 | t.column "user_id", :integer, :default => 0, :null => false | |
195 | t.column "action", :string, :limit => 30, :default => "", :null => false |
|
195 | t.column "action", :string, :limit => 30, :default => "", :null => false | |
196 | t.column "value", :string, :limit => 40, :default => "", :null => false |
|
196 | t.column "value", :string, :limit => 40, :default => "", :null => false | |
197 | t.column "created_on", :datetime, :null => false |
|
197 | t.column "created_on", :datetime, :null => false | |
198 | end |
|
198 | end | |
199 |
|
199 | |||
200 | create_table "trackers", :force => true do |t| |
|
200 | create_table "trackers", :force => true do |t| | |
201 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
201 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
202 | t.column "is_in_chlog", :boolean, :default => false, :null => false |
|
202 | t.column "is_in_chlog", :boolean, :default => false, :null => false | |
203 | end |
|
203 | end | |
204 |
|
204 | |||
205 | create_table "users", :force => true do |t| |
|
205 | create_table "users", :force => true do |t| | |
206 | t.column "login", :string, :limit => 30, :default => "", :null => false |
|
206 | t.column "login", :string, :limit => 30, :default => "", :null => false | |
207 | t.column "hashed_password", :string, :limit => 40, :default => "", :null => false |
|
207 | t.column "hashed_password", :string, :limit => 40, :default => "", :null => false | |
208 | t.column "firstname", :string, :limit => 30, :default => "", :null => false |
|
208 | t.column "firstname", :string, :limit => 30, :default => "", :null => false | |
209 | t.column "lastname", :string, :limit => 30, :default => "", :null => false |
|
209 | t.column "lastname", :string, :limit => 30, :default => "", :null => false | |
210 | t.column "mail", :string, :limit => 60, :default => "", :null => false |
|
210 | t.column "mail", :string, :limit => 60, :default => "", :null => false | |
211 | t.column "mail_notification", :boolean, :default => true, :null => false |
|
211 | t.column "mail_notification", :boolean, :default => true, :null => false | |
212 | t.column "admin", :boolean, :default => false, :null => false |
|
212 | t.column "admin", :boolean, :default => false, :null => false | |
213 | t.column "status", :integer, :default => 1, :null => false |
|
213 | t.column "status", :integer, :default => 1, :null => false | |
214 | t.column "last_login_on", :datetime |
|
214 | t.column "last_login_on", :datetime | |
215 | t.column "language", :string, :limit => 2, :default => "" |
|
215 | t.column "language", :string, :limit => 2, :default => "" | |
216 | t.column "auth_source_id", :integer |
|
216 | t.column "auth_source_id", :integer | |
217 | t.column "created_on", :timestamp |
|
217 | t.column "created_on", :timestamp | |
218 | t.column "updated_on", :timestamp |
|
218 | t.column "updated_on", :timestamp | |
219 | end |
|
219 | end | |
220 |
|
220 | |||
221 | create_table "versions", :force => true do |t| |
|
221 | create_table "versions", :force => true do |t| | |
222 | t.column "project_id", :integer, :default => 0, :null => false |
|
222 | t.column "project_id", :integer, :default => 0, :null => false | |
223 | t.column "name", :string, :limit => 30, :default => "", :null => false |
|
223 | t.column "name", :string, :limit => 30, :default => "", :null => false | |
224 | t.column "description", :string, :default => "" |
|
224 | t.column "description", :string, :default => "" | |
225 | t.column "effective_date", :date |
|
225 | t.column "effective_date", :date | |
226 | t.column "created_on", :timestamp |
|
226 | t.column "created_on", :timestamp | |
227 | t.column "updated_on", :timestamp |
|
227 | t.column "updated_on", :timestamp | |
228 | end |
|
228 | end | |
229 |
|
229 | |||
230 | add_index "versions", ["project_id"], :name => "versions_project_id" |
|
230 | add_index "versions", ["project_id"], :name => "versions_project_id" | |
231 |
|
231 | |||
232 | create_table "workflows", :force => true do |t| |
|
232 | create_table "workflows", :force => true do |t| | |
233 | t.column "tracker_id", :integer, :default => 0, :null => false |
|
233 | t.column "tracker_id", :integer, :default => 0, :null => false | |
234 | t.column "old_status_id", :integer, :default => 0, :null => false |
|
234 | t.column "old_status_id", :integer, :default => 0, :null => false | |
235 | t.column "new_status_id", :integer, :default => 0, :null => false |
|
235 | t.column "new_status_id", :integer, :default => 0, :null => false | |
236 | t.column "role_id", :integer, :default => 0, :null => false |
|
236 | t.column "role_id", :integer, :default => 0, :null => false | |
237 | end |
|
237 | end | |
238 |
|
238 | |||
239 | # project |
|
239 | # project | |
240 | Permission.create :controller => "projects", :action => "show", :description => "label_overview", :sort => 100, :is_public => true |
|
240 | Permission.create :controller => "projects", :action => "show", :description => "label_overview", :sort => 100, :is_public => true | |
241 | Permission.create :controller => "projects", :action => "changelog", :description => "label_change_log", :sort => 105, :is_public => true |
|
241 | Permission.create :controller => "projects", :action => "changelog", :description => "label_change_log", :sort => 105, :is_public => true | |
242 | Permission.create :controller => "reports", :action => "issue_report", :description => "label_report_plural", :sort => 110, :is_public => true |
|
242 | Permission.create :controller => "reports", :action => "issue_report", :description => "label_report_plural", :sort => 110, :is_public => true | |
243 | Permission.create :controller => "projects", :action => "settings", :description => "label_settings", :sort => 150 |
|
243 | Permission.create :controller => "projects", :action => "settings", :description => "label_settings", :sort => 150 | |
244 | Permission.create :controller => "projects", :action => "edit", :description => "button_edit", :sort => 151 |
|
244 | Permission.create :controller => "projects", :action => "edit", :description => "button_edit", :sort => 151 | |
245 | # members |
|
245 | # members | |
246 | Permission.create :controller => "projects", :action => "list_members", :description => "button_list", :sort => 200, :is_public => true |
|
246 | Permission.create :controller => "projects", :action => "list_members", :description => "button_list", :sort => 200, :is_public => true | |
247 | Permission.create :controller => "projects", :action => "add_member", :description => "button_add", :sort => 220 |
|
247 | Permission.create :controller => "projects", :action => "add_member", :description => "button_add", :sort => 220 | |
248 | Permission.create :controller => "members", :action => "edit", :description => "button_edit", :sort => 221 |
|
248 | Permission.create :controller => "members", :action => "edit", :description => "button_edit", :sort => 221 | |
249 | Permission.create :controller => "members", :action => "destroy", :description => "button_delete", :sort => 222 |
|
249 | Permission.create :controller => "members", :action => "destroy", :description => "button_delete", :sort => 222 | |
250 | # versions |
|
250 | # versions | |
251 | Permission.create :controller => "projects", :action => "add_version", :description => "button_add", :sort => 320 |
|
251 | Permission.create :controller => "projects", :action => "add_version", :description => "button_add", :sort => 320 | |
252 | Permission.create :controller => "versions", :action => "edit", :description => "button_edit", :sort => 321 |
|
252 | Permission.create :controller => "versions", :action => "edit", :description => "button_edit", :sort => 321 | |
253 | Permission.create :controller => "versions", :action => "destroy", :description => "button_delete", :sort => 322 |
|
253 | Permission.create :controller => "versions", :action => "destroy", :description => "button_delete", :sort => 322 | |
254 | # issue categories |
|
254 | # issue categories | |
255 | Permission.create :controller => "projects", :action => "add_issue_category", :description => "button_add", :sort => 420 |
|
255 | Permission.create :controller => "projects", :action => "add_issue_category", :description => "button_add", :sort => 420 | |
256 | Permission.create :controller => "issue_categories", :action => "edit", :description => "button_edit", :sort => 421 |
|
256 | Permission.create :controller => "issue_categories", :action => "edit", :description => "button_edit", :sort => 421 | |
257 | Permission.create :controller => "issue_categories", :action => "destroy", :description => "button_delete", :sort => 422 |
|
257 | Permission.create :controller => "issue_categories", :action => "destroy", :description => "button_delete", :sort => 422 | |
258 | # issues |
|
258 | # issues | |
259 | Permission.create :controller => "projects", :action => "list_issues", :description => "button_list", :sort => 1000, :is_public => true |
|
259 | Permission.create :controller => "projects", :action => "list_issues", :description => "button_list", :sort => 1000, :is_public => true | |
260 | Permission.create :controller => "projects", :action => "export_issues_csv", :description => "label_export_csv", :sort => 1001, :is_public => true |
|
260 | Permission.create :controller => "projects", :action => "export_issues_csv", :description => "label_export_csv", :sort => 1001, :is_public => true | |
261 | Permission.create :controller => "issues", :action => "show", :description => "button_view", :sort => 1005, :is_public => true |
|
261 | Permission.create :controller => "issues", :action => "show", :description => "button_view", :sort => 1005, :is_public => true | |
262 | Permission.create :controller => "issues", :action => "download", :description => "button_download", :sort => 1010, :is_public => true |
|
262 | Permission.create :controller => "issues", :action => "download", :description => "button_download", :sort => 1010, :is_public => true | |
263 | Permission.create :controller => "projects", :action => "add_issue", :description => "button_add", :sort => 1050, :mail_option => 1, :mail_enabled => 1 |
|
263 | Permission.create :controller => "projects", :action => "add_issue", :description => "button_add", :sort => 1050, :mail_option => 1, :mail_enabled => 1 | |
264 | Permission.create :controller => "issues", :action => "edit", :description => "button_edit", :sort => 1055 |
|
264 | Permission.create :controller => "issues", :action => "edit", :description => "button_edit", :sort => 1055 | |
265 | Permission.create :controller => "issues", :action => "change_status", :description => "label_change_status", :sort => 1060, :mail_option => 1, :mail_enabled => 1 |
|
265 | Permission.create :controller => "issues", :action => "change_status", :description => "label_change_status", :sort => 1060, :mail_option => 1, :mail_enabled => 1 | |
266 | Permission.create :controller => "issues", :action => "destroy", :description => "button_delete", :sort => 1065 |
|
266 | Permission.create :controller => "issues", :action => "destroy", :description => "button_delete", :sort => 1065 | |
267 | Permission.create :controller => "issues", :action => "add_attachment", :description => "label_attachment_new", :sort => 1070 |
|
267 | Permission.create :controller => "issues", :action => "add_attachment", :description => "label_attachment_new", :sort => 1070 | |
268 | Permission.create :controller => "issues", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1075 |
|
268 | Permission.create :controller => "issues", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1075 | |
269 | # news |
|
269 | # news | |
270 | Permission.create :controller => "projects", :action => "list_news", :description => "button_list", :sort => 1100, :is_public => true |
|
270 | Permission.create :controller => "projects", :action => "list_news", :description => "button_list", :sort => 1100, :is_public => true | |
271 | Permission.create :controller => "news", :action => "show", :description => "button_view", :sort => 1101, :is_public => true |
|
271 | Permission.create :controller => "news", :action => "show", :description => "button_view", :sort => 1101, :is_public => true | |
272 | Permission.create :controller => "projects", :action => "add_news", :description => "button_add", :sort => 1120 |
|
272 | Permission.create :controller => "projects", :action => "add_news", :description => "button_add", :sort => 1120 | |
273 | Permission.create :controller => "news", :action => "edit", :description => "button_edit", :sort => 1121 |
|
273 | Permission.create :controller => "news", :action => "edit", :description => "button_edit", :sort => 1121 | |
274 | Permission.create :controller => "news", :action => "destroy", :description => "button_delete", :sort => 1122 |
|
274 | Permission.create :controller => "news", :action => "destroy", :description => "button_delete", :sort => 1122 | |
275 | # documents |
|
275 | # documents | |
276 | Permission.create :controller => "projects", :action => "list_documents", :description => "button_list", :sort => 1200, :is_public => true |
|
276 | Permission.create :controller => "projects", :action => "list_documents", :description => "button_list", :sort => 1200, :is_public => true | |
277 | Permission.create :controller => "documents", :action => "show", :description => "button_view", :sort => 1201, :is_public => true |
|
277 | Permission.create :controller => "documents", :action => "show", :description => "button_view", :sort => 1201, :is_public => true | |
278 | Permission.create :controller => "documents", :action => "download", :description => "button_download", :sort => 1202, :is_public => true |
|
278 | Permission.create :controller => "documents", :action => "download", :description => "button_download", :sort => 1202, :is_public => true | |
279 | Permission.create :controller => "projects", :action => "add_document", :description => "button_add", :sort => 1220 |
|
279 | Permission.create :controller => "projects", :action => "add_document", :description => "button_add", :sort => 1220 | |
280 | Permission.create :controller => "documents", :action => "edit", :description => "button_edit", :sort => 1221 |
|
280 | Permission.create :controller => "documents", :action => "edit", :description => "button_edit", :sort => 1221 | |
281 | Permission.create :controller => "documents", :action => "destroy", :description => "button_delete", :sort => 1222 |
|
281 | Permission.create :controller => "documents", :action => "destroy", :description => "button_delete", :sort => 1222 | |
282 | Permission.create :controller => "documents", :action => "add_attachment", :description => "label_attachment_new", :sort => 1223 |
|
282 | Permission.create :controller => "documents", :action => "add_attachment", :description => "label_attachment_new", :sort => 1223 | |
283 | Permission.create :controller => "documents", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1224 |
|
283 | Permission.create :controller => "documents", :action => "destroy_attachment", :description => "label_attachment_delete", :sort => 1224 | |
284 | # files |
|
284 | # files | |
285 | Permission.create :controller => "projects", :action => "list_files", :description => "button_list", :sort => 1300, :is_public => true |
|
285 | Permission.create :controller => "projects", :action => "list_files", :description => "button_list", :sort => 1300, :is_public => true | |
286 | Permission.create :controller => "versions", :action => "download", :description => "button_download", :sort => 1301, :is_public => true |
|
286 | Permission.create :controller => "versions", :action => "download", :description => "button_download", :sort => 1301, :is_public => true | |
287 | Permission.create :controller => "projects", :action => "add_file", :description => "button_add", :sort => 1320 |
|
287 | Permission.create :controller => "projects", :action => "add_file", :description => "button_add", :sort => 1320 | |
288 | Permission.create :controller => "versions", :action => "destroy_file", :description => "button_delete", :sort => 1322 |
|
288 | Permission.create :controller => "versions", :action => "destroy_file", :description => "button_delete", :sort => 1322 | |
289 |
|
289 | |||
290 | # create default administrator account |
|
290 | # create default administrator account | |
291 | user = User.new :firstname => "Redmine", |
|
291 | user = User.new :firstname => "Redmine", | |
292 | :lastname => "Admin", |
|
292 | :lastname => "Admin", | |
293 | :mail => "admin@example.net", |
|
293 | :mail => "admin@example.net", | |
294 |
:mail_notification => |
|
294 | :mail_notification => true, | |
295 | :status => 1 |
|
295 | :status => 1 | |
296 | user.login = 'admin' |
|
296 | user.login = 'admin' | |
297 | user.hashed_password = "d033e22ae348aeb5660fc2140aec35850c4da997" |
|
297 | user.hashed_password = "d033e22ae348aeb5660fc2140aec35850c4da997" | |
298 | user.admin = true |
|
298 | user.admin = true | |
299 | user.save |
|
299 | user.save | |
300 |
|
300 | |||
301 |
|
301 | |||
302 | end |
|
302 | end | |
303 |
|
303 | |||
304 | def self.down |
|
304 | def self.down | |
305 | drop_table :attachments |
|
305 | drop_table :attachments | |
306 | drop_table :auth_sources |
|
306 | drop_table :auth_sources | |
307 | drop_table :custom_fields |
|
307 | drop_table :custom_fields | |
308 | drop_table :custom_fields_projects |
|
308 | drop_table :custom_fields_projects | |
309 | drop_table :custom_fields_trackers |
|
309 | drop_table :custom_fields_trackers | |
310 | drop_table :custom_values |
|
310 | drop_table :custom_values | |
311 | drop_table :documents |
|
311 | drop_table :documents | |
312 | drop_table :enumerations |
|
312 | drop_table :enumerations | |
313 | drop_table :issue_categories |
|
313 | drop_table :issue_categories | |
314 | drop_table :issue_histories |
|
314 | drop_table :issue_histories | |
315 | drop_table :issue_statuses |
|
315 | drop_table :issue_statuses | |
316 | drop_table :issues |
|
316 | drop_table :issues | |
317 | drop_table :members |
|
317 | drop_table :members | |
318 | drop_table :news |
|
318 | drop_table :news | |
319 | drop_table :permissions |
|
319 | drop_table :permissions | |
320 | drop_table :permissions_roles |
|
320 | drop_table :permissions_roles | |
321 | drop_table :projects |
|
321 | drop_table :projects | |
322 | drop_table :roles |
|
322 | drop_table :roles | |
323 | drop_table :trackers |
|
323 | drop_table :trackers | |
324 | drop_table :tokens |
|
324 | drop_table :tokens | |
325 | drop_table :users |
|
325 | drop_table :users | |
326 | drop_table :versions |
|
326 | drop_table :versions | |
327 | drop_table :workflows |
|
327 | drop_table :workflows | |
328 | end |
|
328 | end | |
329 | end |
|
329 | end |
General Comments 0
You need to be logged in to leave comments.
Login now