Class: Jun::CLI::Commands::DB::Create

Inherits:
Base show all
Defined in:
lib/jun/cli/commands/db/create.rb

Instance Method Summary collapse

Methods inherited from Base

command_name

Instance Method Details

#process(*args) ⇒ Object



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

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

  if File.exist?(db_filepath)
    puts "Database already exists."
  else
    File.open(db_filepath, "w") {}
    create_schema_migrations_table
    puts "Created database in #{db_filepath}."
  end
end