Class: Apartment::CLI::Migrations
- Inherits:
-
Thor
- Object
- Thor
- Apartment::CLI::Migrations
- Defined in:
- lib/apartment/cli/migrations.rb
Constant Summary collapse
- FAILED_TENANTS_PREVIEW =
The raised Thor::Error message is the low-context surface a monitor or CI-log tail captures even when the stdout summary is dropped/unindexed. Name a few failed tenants there (capped, so a 600-tenant run does not produce a wall of text); the full per-tenant detail is in the summary and in the migrate_tenant_failed.apartment events.
5
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
15 |
# File 'lib/apartment/cli/migrations.rb', line 15 def self.exit_on_failure? = true |
Instance Method Details
#migrate(tenant = nil) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/apartment/cli/migrations.rb', line 29 def migrate(tenant = nil) require('apartment/migrator') if tenant migrate_single(tenant) else migrate_all end end |
#rollback(tenant = nil) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/apartment/cli/migrations.rb', line 45 def rollback(tenant = nil) if tenant rollback_single(tenant) else rollback_all end end |