main
Alpha Chen 1 year ago
parent 668b4b1c96
commit 6a5c734ff1
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

1
.gitignore vendored

@ -0,0 +1 @@
alphadex.db

@ -3,6 +3,7 @@
source "https://rubygems.org"
gem "sequel"
gem "sqlite3"
group :dev do
gem "minitest"

@ -6,6 +6,7 @@ GEM
rake (13.0.6)
sequel (5.73.0)
bigdecimal
sqlite3 (1.6.8-arm64-darwin)
PLATFORMS
arm64-darwin-22
@ -14,6 +15,7 @@ DEPENDENCIES
minitest
rake
sequel
sqlite3
BUNDLED WITH
2.4.1

@ -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…
Cancel
Save