annotate .svn/pristine/7c/7c8477332553f0c9a3e3cf4a6ba241f56066f91e.svn-base @ 1628:9c5f8e24dadc live tip

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