parent
668b4b1c96
commit
6a5c734ff1
@ -0,0 +1 @@
|
||||
alphadex.db
|
@ -1,3 +1,17 @@
|
||||
require "logger"
|
||||
|
||||
require "minitest/test_task"
|
||||
|
||||
Minitest::TestTask.create
|
||||
|
||||
namespace :db do
|
||||
desc "Run migrations"
|
||||
task :migrate, [:version] do |t, args|
|
||||
require "sequel/core"
|
||||
Sequel.extension :migration
|
||||
version = args[:version].to_i if args[:version]
|
||||
Sequel.connect(ENV.fetch("DATABASE_URL"), logger: Logger.new($stderr)) do |db|
|
||||
Sequel::Migrator.run(db, "db/migrations", target: version)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,10 @@
|
||||
Sequel.migration do
|
||||
change do
|
||||
create_table(:entities) do
|
||||
primary_key :id
|
||||
|
||||
DateTime :created_at
|
||||
DateTime :modified_at
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue