Module: Twenty::Migration
- Defined in:
- lib/twenty-backend/migration.rb
Class Method Summary collapse
-
.migrations_path ⇒ String
Returns the path to twenty’s migrations.
-
.pending_migrations? ⇒ Boolean
Returns true when there are pending migrations.
-
.run! ⇒ void
Runs migrations (if neccessary).
Class Method Details
.migrations_path ⇒ String
Returns the path to twenty’s migrations.
7 8 9 |
# File 'lib/twenty-backend/migration.rb', line 7 def self.migrations_path [File.join(__dir__, "migration")] end |
.pending_migrations? ⇒ Boolean
Returns true when there are pending migrations.
22 23 24 |
# File 'lib/twenty-backend/migration.rb', line 22 def self.pending_migrations? context.open.pending_migrations.any? end |
.run! ⇒ void
This method returns an undefined value.
Runs migrations (if neccessary).
14 15 16 |
# File 'lib/twenty-backend/migration.rb', line 14 def self.run! context.migrate end |