Module: Twenty::Migration

Defined in:
lib/twenty/server/migration.rb

Class Method Summary collapse

Class Method Details

.migrations_pathString

Returns the path to the migrations directory

Returns:

  • (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

Returns:

  • (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!(options = {})
  Sequel::Migrator.run(Twenty.connection, migrations_path, options)
end