File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -251,13 +251,15 @@ def self.init_database!
251
251
#CASServer::Model::Base.establish_connection(config[:database])
252
252
ActiveRecord ::Base . establish_connection ( config [ :database ] )
253
253
254
- print_cli_message "Running migrations to make sure your database schema is up to date..."
255
- prev_db_log = ActiveRecord ::Base . logger
256
- ActiveRecord ::Base . logger = Logger . new ( STDOUT )
257
- ActiveRecord ::Migration . verbose = true
258
- ActiveRecord ::Migrator . migrate ( File . dirname ( __FILE__ ) + "/../../db/migrate" )
259
- ActiveRecord ::Base . logger = prev_db_log
260
- print_cli_message "Your database is now up to date."
254
+ unless config [ :disable_auto_migrations ]
255
+ print_cli_message "Running migrations to make sure your database schema is up to date..."
256
+ prev_db_log = ActiveRecord ::Base . logger
257
+ ActiveRecord ::Base . logger = Logger . new ( STDOUT )
258
+ ActiveRecord ::Migration . verbose = true
259
+ ActiveRecord ::Migrator . migrate ( File . dirname ( __FILE__ ) + "/../../db/migrate" )
260
+ ActiveRecord ::Base . logger = prev_db_log
261
+ print_cli_message "Your database is now up to date."
262
+ end
261
263
end
262
264
263
265
configure do
Original file line number Diff line number Diff line change @@ -203,6 +203,12 @@ database:
203
203
# dbfile: /var/lib/casserver.db
204
204
205
205
206
+ # By default RubyCAS-Server will run migrations at every startup to ensure
207
+ # that its database schema is up-to-date. To disable this behaviour set
208
+ # the following option to true:
209
+
210
+ # disable_auto_migrations: true
211
+
206
212
# #### AUTHENTICATION ###########################################################
207
213
208
214
# Configure how username/passwords are validated.
You can’t perform that action at this time.
0 commit comments