Module: Twenty::Migration
- Defined in:
- lib/twenty/server/migration.rb
Class Method Summary collapse
-
.migrations_path ⇒ String
Returns the path to the migrations directory.
-
.pending_migrations? ⇒ Boolean
Returns true when there are pending migrations.
-
.run!(options = {}) ⇒ void
Run migrations.
Class Method Details
.migrations_path ⇒ String
Returns the path to the migrations directory
9 10 11 |
# File 'lib/twenty/server/migration.rb', line 9 def self.migrations_path File.join(__dir__, "migration") end |
.pending_migrations? ⇒ Boolean
Returns true when there are pending migrations
23 24 25 |
# File 'lib/twenty/server/migration.rb', line 23 def self.pending_migrations? ! Sequel::Migrator.is_current?(Twenty.connection, migrations_path) end |
.run!(options = {}) ⇒ void
This method returns an undefined value.
Run migrations
16 17 18 |
# File 'lib/twenty/server/migration.rb', line 16 def self.run!( = {}) Sequel::Migrator.run(Twenty.connection, migrations_path, ) end |