Class: SlashMigrate::MigrationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/slash_migrate/migrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



19
20
21
22
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 19

def destroy
  @result = runner.delete(params[:version])
  stream_result
end

#indexObject



3
4
5
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 3

def index
  load_migrations
end

#rollbackObject



13
14
15
16
17
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 13

def rollback
  @result = runner.rollback
  @command = "rails db:rollback"
  stream_result
end

#runObject



7
8
9
10
11
# File 'app/controllers/slash_migrate/migrations_controller.rb', line 7

def run
  @result = runner.migrate
  @command = "rails db:migrate"
  stream_result
end