Fixed a couple small things; added database stuff

This commit is contained in:
Gregory Ballantine 2024-07-03 09:39:28 -04:00
parent fb7f99d67b
commit 5a264ddf5e
5 changed files with 25 additions and 4 deletions

View File

@ -4,4 +4,4 @@ $conf = Config.new(File.join(__dir__, 'config/defaults.yaml'))
root = ::File.dirname(__FILE__) root = ::File.dirname(__FILE__)
require ::File.join( root, 'src', 'server' ) require ::File.join( root, 'src', 'server' )
run GameData.new run Destructo.new

View File

@ -2,5 +2,5 @@ database:
adapter: 'sqlite' adapter: 'sqlite'
database: 'data/destructo.db' database: 'data/destructo.db'
testing: messages:
minimum_results_required: 3 soft_delete: false

View File

@ -0,0 +1,16 @@
Sequel.migration do
up do
create_table(:messages) do
primary_key :id
String :body, null: false
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
end
end
down do
drop_table(:messages)
end
end

View File

@ -1,3 +1,3 @@
# frozen_string_literal: true # frozen_string_literal: true
# Will add models to load here require_relative 'message'

5
src/models/message.rb Normal file
View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
# Message - database model for messages
class Message < Sequel::Model
end