Module: Twenty::Migration

Defined in:
lib/twenty-backend/migration.rb

Class Method Summary collapse

Class Method Details

.migrations_pathString

Returns the path to twenty’s migrations.

Returns:

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

Returns:

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