Fixed a couple small things; added database stuff
This commit is contained in:
parent
fb7f99d67b
commit
5a264ddf5e
@ -4,4 +4,4 @@ $conf = Config.new(File.join(__dir__, 'config/defaults.yaml'))
|
||||
|
||||
root = ::File.dirname(__FILE__)
|
||||
require ::File.join( root, 'src', 'server' )
|
||||
run GameData.new
|
||||
run Destructo.new
|
||||
|
@ -2,5 +2,5 @@ database:
|
||||
adapter: 'sqlite'
|
||||
database: 'data/destructo.db'
|
||||
|
||||
testing:
|
||||
minimum_results_required: 3
|
||||
messages:
|
||||
soft_delete: false
|
||||
|
16
db/migrations/0001_add_messages_table.rb
Normal file
16
db/migrations/0001_add_messages_table.rb
Normal 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
|
@ -1,3 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Will add models to load here
|
||||
require_relative 'message'
|
||||
|
5
src/models/message.rb
Normal file
5
src/models/message.rb
Normal file
@ -0,0 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Message - database model for messages
|
||||
class Message < Sequel::Model
|
||||
end
|
Loading…
Reference in New Issue
Block a user