Module: StrongMigrations
- Defined in:
- lib/strong_migrations.rb,
lib/strong_migrations/checker.rb,
lib/strong_migrations/railtie.rb,
lib/strong_migrations/version.rb,
lib/strong_migrations/migration.rb,
lib/strong_migrations/database_tasks.rb,
lib/strong_migrations/migration_helpers.rb,
lib/strong_migrations/alphabetize_columns.rb
Defined Under Namespace
Modules: AlphabetizeColumns, DatabaseTasks, Migration, MigrationHelpers Classes: Checker, Error, Railtie, UnsafeMigration
Constant Summary collapse
- VERSION =
"0.6.1"
Class Attribute Summary collapse
-
.auto_analyze ⇒ Object
Returns the value of attribute auto_analyze.
-
.checks ⇒ Object
Returns the value of attribute checks.
-
.enabled_checks ⇒ Object
Returns the value of attribute enabled_checks.
-
.error_messages ⇒ Object
Returns the value of attribute error_messages.
-
.helpers ⇒ Object
Returns the value of attribute helpers.
-
.lock_timeout ⇒ Object
Returns the value of attribute lock_timeout.
-
.start_after ⇒ Object
Returns the value of attribute start_after.
-
.statement_timeout ⇒ Object
Returns the value of attribute statement_timeout.
-
.target_mariadb_version ⇒ Object
Returns the value of attribute target_mariadb_version.
-
.target_mysql_version ⇒ Object
Returns the value of attribute target_mysql_version.
-
.target_postgresql_version ⇒ Object
Returns the value of attribute target_postgresql_version.
Class Method Summary collapse
- .add_check(&block) ⇒ Object
- .check_enabled?(check, version: nil) ⇒ Boolean
- .disable_check(check) ⇒ Object
- .enable_check(check, start_after: nil) ⇒ Object
Class Attribute Details
.auto_analyze ⇒ Object
Returns the value of attribute auto_analyze.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def auto_analyze @auto_analyze end |
.checks ⇒ Object
Returns the value of attribute checks.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def checks @checks end |
.enabled_checks ⇒ Object
Returns the value of attribute enabled_checks.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def enabled_checks @enabled_checks end |
.error_messages ⇒ Object
Returns the value of attribute error_messages.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def @error_messages end |
.helpers ⇒ Object
Returns the value of attribute helpers.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def helpers @helpers end |
.lock_timeout ⇒ Object
Returns the value of attribute lock_timeout.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def lock_timeout @lock_timeout end |
.start_after ⇒ Object
Returns the value of attribute start_after.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def start_after @start_after end |
.statement_timeout ⇒ Object
Returns the value of attribute statement_timeout.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def statement_timeout @statement_timeout end |
.target_mariadb_version ⇒ Object
Returns the value of attribute target_mariadb_version.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def target_mariadb_version @target_mariadb_version end |
.target_mysql_version ⇒ Object
Returns the value of attribute target_mysql_version.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def target_mysql_version @target_mysql_version end |
.target_postgresql_version ⇒ Object
Returns the value of attribute target_postgresql_version.
19 20 21 |
# File 'lib/strong_migrations.rb', line 19 def target_postgresql_version @target_postgresql_version end |
Class Method Details
.add_check(&block) ⇒ Object
233 234 235 |
# File 'lib/strong_migrations.rb', line 233 def self.add_check(&block) checks << block end |
.check_enabled?(check, version: nil) ⇒ Boolean
245 246 247 248 249 250 251 252 |
# File 'lib/strong_migrations.rb', line 245 def self.check_enabled?(check, version: nil) if enabled_checks[check] start_after = enabled_checks[check][:start_after] || StrongMigrations.start_after !version || version > start_after else false end end |
.disable_check(check) ⇒ Object
241 242 243 |
# File 'lib/strong_migrations.rb', line 241 def self.disable_check(check) enabled_checks.delete(check) end |
.enable_check(check, start_after: nil) ⇒ Object
237 238 239 |
# File 'lib/strong_migrations.rb', line 237 def self.enable_check(check, start_after: nil) enabled_checks[check] = {start_after: start_after} end |