Sha256: bd9c9a531d617bacbbc0cf8b9bc3820dc8f0e36f9dc13a1c429e2d707ee59753
Contents?: true
Size: 930 Bytes
Versions: 8
Compression:
Stored size: 930 Bytes
Contents
# frozen_string_literal: true require_relative "../../application" require_relative "structure/dump" module Hanami module CLI module Commands module Monolith module DB class Migrate < Application desc "Migrates database" option :target, desc: "Target migration number", aliases: ["-t"] def call(target: nil, **) return true if Dir[File.join(application.root, "db/migrate/*.rb")].empty? measure "database #{database.name} migrated" do if target run_migrations(target: Integer(target)) else run_migrations end true end end private def run_migrations(**options) database.run_migrations(**options) end end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems