Created
February 24, 2013 00:42
-
-
Save Mizpah/5022078 to your computer and use it in GitHub Desktop.
Am working on an application that will play the role of a guild website, alongside the multiple systems that a guild needs. (mmo and other gaming communities). This has come about of the back of crating multiple website/system for this purpose that have to be scrapped whenever we change game, and getting tired of people needing good guild websit…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
encoding: UTF-8 | |
# This file is auto-generated from the current state of the database. Instead | |
# of editing this file, please use the migrations feature of Active Record to | |
# incrementally modify your database, and then regenerate this schema definition. | |
# | |
# Note that this schema.rb definition is the authoritative source for your | |
# database schema. If you need to create the application database on another | |
# system, you should be using db:schema:load, not running all the migrations | |
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | |
# you'll amass, the slower it'll run and the greater likelihood for issues). | |
# | |
# It's strongly recommended to check this file into your version control system. | |
ActiveRecord::Schema.define(:version => 20130222134729) do | |
create_table "game_classes", :force => true do |t| | |
t.string "name" | |
t.text "description" | |
t.datetime "created_at", :null => false | |
t.datetime "updated_at", :null => false | |
t.integer "game_id", :default => 1 | |
end | |
create_table "game_factions", :force => true do |t| | |
t.string "name" | |
t.text "description" | |
t.datetime "created_at", :null => false | |
t.datetime "updated_at", :null => false | |
t.integer "game_id", :default => 1 | |
end | |
create_table "game_races", :force => true do |t| | |
t.string "name" | |
t.text "description" | |
t.datetime "created_at", :null => false | |
t.datetime "updated_at", :null => false | |
t.integer "game_id", :default => 1 | |
end | |
create_table "games", :force => true do |t| | |
t.string "name" | |
t.text "description" | |
t.string "game_version" | |
t.string "data_version" | |
t.datetime "created_at", :null => false | |
t.datetime "updated_at", :null => false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Serializing your data
One idea is to express your system's data in yaml files.
If WoW adds a new class, you add a few lines and commit the changes. Your representation of games are now versionable.
I wrote that yaml file off the top of my head. Assuming I got the syntax right, it'll be parsed into a Ruby hash that looks like this:
You could write a Rake task that reads all the game yaml files (one for each game) and populates the database from them.
Just a general idea.
Imagine if running
rake seed_games
brought your DB up to speed with whatever you had ingame_files/**.yml
.