Module: Twenty::Migration
- Defined in:
- lib/twenty/server/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.
8 9 10 |
# File 'lib/twenty/server/migration.rb', line 8 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/server/migration.rb', line 22 def self.pending_migrations? Sequel::Migrator.is_current?(Twenty.connection, migrations_path) end |
.run! ⇒ void
This method returns an undefined value.
Runs migrations (if neccessary).
15 16 17 |
# File 'lib/twenty/server/migration.rb', line 15 def self.run! Sequel::Migrator.run(Twenty.connection, migrations_path) end |