Class: Jun::CLI::Commands::DB::Schema::Load

Inherits:
Base
  • Object
show all
Defined in:
lib/jun/cli/commands/db/schema/load.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
19
20
# File 'lib/jun/cli/commands/db/schema/load.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_filepath}")
  end

  populate_schema_migrations!

  puts "Database schema loaded."
end