Add -t, --target
This commit is contained in:
parent
3105be205e
commit
e651789ed4
2 changed files with 6 additions and 4 deletions
|
@ -3,6 +3,8 @@
|
||||||
class Twenty::Command::Migrate < Twenty::Command
|
class Twenty::Command::Migrate < Twenty::Command
|
||||||
set_banner usage: "twenty migrate [OPTIONS]",
|
set_banner usage: "twenty migrate [OPTIONS]",
|
||||||
description: "Migrate the database"
|
description: "Migrate the database"
|
||||||
|
set_option "-t TARGET", "--target TARGET", "The target version", default: nil
|
||||||
|
|
||||||
include CommonOptionMixin
|
include CommonOptionMixin
|
||||||
prepend Twenty::Command::SQLiteMixin
|
prepend Twenty::Command::SQLiteMixin
|
||||||
prepend Twenty::Command::RescueMixin
|
prepend Twenty::Command::RescueMixin
|
||||||
|
@ -15,6 +17,6 @@ class Twenty::Command::Migrate < Twenty::Command
|
||||||
private
|
private
|
||||||
|
|
||||||
def run_command(options)
|
def run_command(options)
|
||||||
Twenty::Migration.run!
|
Twenty::Migration.run!(target: options.target)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,10 +10,10 @@ module Twenty::Migration
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Runs migrations (if neccessary).
|
# Run migrations
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def self.run!
|
def self.run!(options = {})
|
||||||
Sequel::Migrator.run(Twenty.connection, migrations_path)
|
Sequel::Migrator.run(Twenty.connection, migrations_path, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in a new issue