Class: Jun::CLI::Commands::DB::Schema::Dump

Inherits:
Base
  • Object
show all
Defined in:
lib/jun/cli/commands/db/schema/dump.rb

Instance Method Summary collapse

Methods inherited from Base

command_name

Instance Method Details

#process(*args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/jun/cli/commands/db/schema/dump.rb', line 9

def process(*args)
  schema_filepath = Jun.root.join("db/schema.sql")
  db_filepath = Jun.root.join("db/app.db")

  Bundler.with_original_env do
    system("bundle exec sqlite3 #{db_filepath} .schema > #{schema_filepath}")
  end

  puts "Database schema updated."
end