Purged git history and removed sensitive information.

This commit is contained in:
Luke Barratt 2014-03-23 00:22:25 +00:00
commit 6bcc8dc76b
862 changed files with 25312 additions and 0 deletions

140
db/fix.sql Normal file
View file

@ -0,0 +1,140 @@
update `articles` set `text` = replace(`text` ,'É','É');
update `articles` set `text` = replace(`text` ,'“','"');
update `articles` set `text` = replace(`text` ,'â€','"');
update `articles` set `text` = replace(`text` ,'Ç','Ç');
update `articles` set `text` = replace(`text` ,'Ã','Ã');
update `articles` set `text` = replace(`text` ,'Ã','À');
update `articles` set `text` = replace(`text` ,'ú','ú');
update `articles` set `text` = replace(`text` ,'•','-');
update `articles` set `text` = replace(`text` ,'Ø','Ø');
update `articles` set `text` = replace(`text` ,'õ','õ');
update `articles` set `text` = replace(`text` ,'í','í');
update `articles` set `text` = replace(`text` ,'â','â');
update `articles` set `text` = replace(`text` ,'ã','ã');
update `articles` set `text` = replace(`text` ,'ê','ê');
update `articles` set `text` = replace(`text` ,'á','á');
update `articles` set `text` = replace(`text` ,'é','é');
update `articles` set `text` = replace(`text` ,'ó','ó');
update `articles` set `text` = replace(`text` ,'–','');
update `articles` set `text` = replace(`text` ,'ç','ç');
update `articles` set `text` = replace(`text` ,'ª','ª');
update `articles` set `text` = replace(`text` ,'º','º');
update `articles` set `text` = replace(`text` ,'Ã ','à');
update `articles` set `text` = replace(`text` ,'ç','ç');
update `articles` set `text` = replace(`text` ,'ã','ã');
update `articles` set `text` = replace(`text` ,'á','á');
update `articles` set `text` = replace(`text` ,'â','â');
update `articles` set `text` = replace(`text` ,'é','é');
update `articles` set `text` = replace(`text` ,'í','í');
update `articles` set `text` = replace(`text` ,'õ','õ');
update `articles` set `text` = replace(`text` ,'ú','ú');
update `articles` set `text` = replace(`text` ,'ç','ç');
update `articles` set `text` = replace(`text` ,'Á','Á');
update `articles` set `text` = replace(`text` ,'Â','Â');
update `articles` set `text` = replace(`text` ,'É','É');
update `articles` set `text` = replace(`text` ,'Í','Í');
update `articles` set `text` = replace(`text` ,'Õ','Õ');
update `articles` set `text` = replace(`text` ,'Ú','Ú');
update `articles` set `text` = replace(`text` ,'Ç','Ç');
update `articles` set `text` = replace(`text` ,'Ã','Ã');
update `articles` set `text` = replace(`text` ,'À','À');
update `articles` set `text` = replace(`text` ,'Ê','Ê');
update `articles` set `text` = replace(`text` ,'Ó','Ó');
update `articles` set `text` = replace(`text` ,'Ô','Ô');
update `articles` set `text` = replace(`text` ,'Ü','Ü');
update `articles` set `text` = replace(`text` ,'ã','ã');
update `articles` set `text` = replace(`text` ,'à','à');
update `articles` set `text` = replace(`text` ,'ê','ê');
update `articles` set `text` = replace(`text` ,'ó','ó');
update `articles` set `text` = replace(`text` ,'ô','ô');
update `articles` set `text` = replace(`text` ,'ü','ü');
update `articles` set `text` = replace(`text` ,'&','&');
update `articles` set `text` = replace(`text` ,'>','>');
update `articles` set `text` = replace(`text` ,'&lt;','<');
update `articles` set `text` = replace(`text` ,'&circ;','ˆ');
update `articles` set `text` = replace(`text` ,'&tilde;','˜');
update `articles` set `text` = replace(`text` ,'&uml;','¨');
update `articles` set `text` = replace(`text` ,'&cute;','´');
update `articles` set `text` = replace(`text` ,'&cedil;','¸');
update `articles` set `text` = replace(`text` ,'&quot;','"');
update `articles` set `text` = replace(`text` ,'&ldquo;','');
update `articles` set `text` = replace(`text` ,'&rdquo;','');
update `articles` set `text` = replace(`text` ,'&lsquo;','');
update `articles` set `text` = replace(`text` ,'&rsquo;','');
update `articles` set `text` = replace(`text` ,'&lsaquo;','');
update `articles` set `text` = replace(`text` ,'&rsaquo;','');
update `articles` set `text` = replace(`text` ,'&laquo;','«');
update `articles` set `text` = replace(`text` ,'&raquo;','»');
update `articles` set `text` = replace(`text` ,'&ordm;','º');
update `articles` set `text` = replace(`text` ,'&ordf;','ª');
update `articles` set `text` = replace(`text` ,'&ndash;','');
update `articles` set `text` = replace(`text` ,'&mdash;','');
update `articles` set `text` = replace(`text` ,'&macr;','¯');
update `articles` set `text` = replace(`text` ,'&hellip;','');
update `articles` set `text` = replace(`text` ,'&brvbar;','¦');
update `articles` set `text` = replace(`text` ,'&bull;','');
update `articles` set `text` = replace(`text` ,'&para;','');
update `articles` set `text` = replace(`text` ,'&sect;','§');
update `articles` set `text` = replace(`text` ,'&sup1;','¹');
update `articles` set `text` = replace(`text` ,'&sup2;','²');
update `articles` set `text` = replace(`text` ,'&sup3;','³');
update `articles` set `text` = replace(`text` ,'&frac12;','½');
update `articles` set `text` = replace(`text` ,'&frac14;','¼');
update `articles` set `text` = replace(`text` ,'&frac34;','¾');
update `articles` set `text` = replace(`text` ,'&#8539;','');
update `articles` set `text` = replace(`text` ,'&#8540;','');
update `articles` set `text` = replace(`text` ,'&#8541;','');
update `articles` set `text` = replace(`text` ,'&#8542;','');
update `articles` set `text` = replace(`text` ,'&gt;','>');
update `articles` set `text` = replace(`text` ,'&lt;','<');
update `articles` set `text` = replace(`text` ,'&plusmn;','±');
update `articles` set `text` = replace(`text` ,'&minus;','');
update `articles` set `text` = replace(`text` ,'&times;','×');
update `articles` set `text` = replace(`text` ,'&divide;','÷');
update `articles` set `text` = replace(`text` ,'&lowast;','');
update `articles` set `text` = replace(`text` ,'&frasl;','');
update `articles` set `text` = replace(`text` ,'&permil;','');
update `articles` set `text` = replace(`text` ,'&int;','');
update `articles` set `text` = replace(`text` ,'&sum;','');
update `articles` set `text` = replace(`text` ,'&prod;','');
update `articles` set `text` = replace(`text` ,'&radic;','');
update `articles` set `text` = replace(`text` ,'&infin;','');
update `articles` set `text` = replace(`text` ,'&asymp;','');
update `articles` set `text` = replace(`text` ,'&cong;','');
update `articles` set `text` = replace(`text` ,'&prop;','');
update `articles` set `text` = replace(`text` ,'&equiv;','');
update `articles` set `text` = replace(`text` ,'&ne;','');
update `articles` set `text` = replace(`text` ,'&le;','');
update `articles` set `text` = replace(`text` ,'&ge;','');
update `articles` set `text` = replace(`text` ,'&there4;','');
update `articles` set `text` = replace(`text` ,'&sdot;','');
update `articles` set `text` = replace(`text` ,'&middot;','·');
update `articles` set `text` = replace(`text` ,'&part;','');
update `articles` set `text` = replace(`text` ,'&image;','');
update `articles` set `text` = replace(`text` ,'&real;','');
update `articles` set `text` = replace(`text` ,'&prime;','');
update `articles` set `text` = replace(`text` ,'&Prime;','');
update `articles` set `text` = replace(`text` ,'&deg;','°');
update `articles` set `text` = replace(`text` ,'&ang;','');
update `articles` set `text` = replace(`text` ,'&perp;','');
update `articles` set `text` = replace(`text` ,'&nabla;','');
update `articles` set `text` = replace(`text` ,'&oplus;','');
update `articles` set `text` = replace(`text` ,'&otimes;','');
update `articles` set `text` = replace(`text` ,'&alefsym;','');
update `articles` set `text` = replace(`text` ,'&oslash;','ø');
update `articles` set `text` = replace(`text` ,'&Oslash;','Ø');
update `articles` set `text` = replace(`text` ,'&isin;','');
update `articles` set `text` = replace(`text` ,'&notin;','');
update `articles` set `text` = replace(`text` ,'&cap;','');
update `articles` set `text` = replace(`text` ,'&cup;','');
update `articles` set `text` = replace(`text` ,'&sub;','');
update `articles` set `text` = replace(`text` ,'&sup;','');
update `articles` set `text` = replace(`text` ,'&sube;','');
update `articles` set `text` = replace(`text` ,'&supe;','');
update `articles` set `text` = replace(`text` ,'&exist;','');
update `articles` set `text` = replace(`text` ,'&forall;','');
update `articles` set `text` = replace(`text` ,'&empty;','');
update `articles` set `text` = replace(`text` ,'&not;','¬');
update `articles` set `text` = replace(`text` ,'&and;','');
update `articles` set `text` = replace(`text` ,'&or;','');
update `articles` set `text` = replace(`text` ,'&crarr;','');

View file

@ -0,0 +1,10 @@
class AddBracketName < ActiveRecord::Migration
def self.up
change_table :brackets do |b|
b.string :name
end
end
def self.down
end
end

View file

@ -0,0 +1,12 @@
class AddPower < ActiveRecord::Migration
def self.up
User.all.each do |user|
if user.team
user.update_attribute :team_id, nil unless user.active_teams.include? user.team
end
end
end
def self.down
end
end

View file

@ -0,0 +1,14 @@
class CreateLogEvents < ActiveRecord::Migration
def self.up
create_table :log_events do |t|
t.string :name
t.string :description
t.integer :team
t.timestamps
end
end
def self.down
drop_table :log_events
end
end

View file

@ -0,0 +1,10 @@
class AddGatherVotes < ActiveRecord::Migration
def self.up
change_table :gathers do |g|
g.integer :votes, :null => false, :default => 0
end
end
def self.down
end
end

View file

@ -0,0 +1,225 @@
class GatherIndexes < ActiveRecord::Migration
def self.up
# These indexes were found by searching for AR::Base finds on your applicaton
# It is strongly recommanded that you will consult a professional DBA about your infrastucture and implemntation before
# changing your database in that matter.
# There is a possibility that some of the indexes offered below is not requ red and can be removed and not added, if you require
# further assistance with your rails application, database infrastructure oany other problem, visit:
#
# http://www.railsmentors.org
# http://www.railstutor.org
# http://guides.rubyonrails.org
add_index :brackets, :contest_id
add_index :contesters, :contest_id
add_index :contesters, :team_id
add_index :directories, :parent_id
add_index :gatherers, :user_id
add_index :teams, :founder_id
add_index :bracketers, :match_id
#add_index :bracketers, :contest_id
add_index :bracketers, :team_id
add_index :matches, :server_id
add_index :matches, :contester1_id
add_index :matches, :contester2_id
add_index :matches, :referee_id
#add_index :matches, :stream_id
add_index :matches, :map1_id
add_index :matches, :contest_id
add_index :matches, :motm_id
add_index :matches, :map2_id
add_index :matches, :challenge_id
add_index :matches, :demo_id
add_index :matches, :week_id
add_index :matches, :hltv_id
add_index :messages, [:sender_id, :sender_type]
add_index :messages, [:recipient_id, :recipient_type]
add_index :watchers, :movie_id
add_index :watchers, :user_id
add_index :comments, :user_id
add_index :contests, :rules_id
add_index :contests, :demos_id
add_index :contests, :winner_id
add_index :gathers, :server_id
add_index :gathers, :captain1_id
add_index :gathers, :map1_id
add_index :gathers, :captain2_id
add_index :gathers, :map2_id
add_index :groups, :founder_id
add_index :rounders, :round_id
add_index :rounders, :team_id
add_index :rounders, :user_id
add_index :teamers, :user_id
add_index :teamers, :team_id
add_index :votes, [:votable_id, :votable_type]
add_index :votes, :user_id
add_index :predictions, :match_id
add_index :predictions, :user_id
add_index :shoutmsgs, :user_id
add_index :topics, :user_id
add_index :contests_maps, [:map_id, :contest_id]
add_index :contests_maps, [:contest_id, :map_id]
add_index :matchers, :match_id
add_index :matchers, :contester_id
add_index :matchers, :user_id
add_index :data_files, :related_id
add_index :data_files, :directory_id
add_index :data_files, :article_id
add_index :articles, :category_id
add_index :articles, :user_id
add_index :forums, :category_id
add_index :groupers, :group_id
add_index :movies, :match_id
add_index :movies, :preview_id
add_index :movies, :user_id
add_index :bans, :server_id
add_index :bans, :user_id
add_index :issues, :assigned_id
add_index :issues, :category_id
add_index :issues, :author_id
add_index :logs, :target_id
add_index :logs, :server_id
add_index :logs, :round_id
add_index :logs, :log_file_id
#add_index :logs, :details_id
add_index :logs, :actor_id
add_index :pcws, :user_id
add_index :pcws, :team_id
add_index :posts, :topic_id
add_index :posts, :user_id
add_index :users, :team_id
add_index :admin_requests, :server_id
add_index :admin_requests, :user_id
add_index :challenges, :server_id
add_index :challenges, :contester1_id
add_index :challenges, :contester2_id
add_index :challenges, :map1_id
add_index :challenges, :map2_id
add_index :challenges, :user_id
add_index :forumers, :group_id
add_index :gather_maps, :map_id
add_index :gather_maps, :gather_id
add_index :polls, :user_id
add_index :rounds, :map_id
add_index :rounds, :team1_id
add_index :rounds, :server_id
add_index :rounds, :match_id
add_index :rounds, :team2_id
add_index :rounds, :commander_id
add_index :servers, :match_id
add_index :servers, :default_id
add_index :servers, :user_id
add_index :weeks, :map1_id
add_index :weeks, :contest_id
add_index :weeks, :map2_id
add_index :log_files, :server_id
end
def self.down
remove_index :brackets, :contest_id
remove_index :contesters, :contest_id
remove_index :contesters, :team_id
remove_index :directories, :parent_id
remove_index :gatherers, :user_id
remove_index :teams, :founder_id
remove_index :bracketers, :match_id
remove_index :bracketers, :contest_id
remove_index :bracketers, :team_id
remove_index :matches, :server_id
remove_index :matches, :contester1_id
remove_index :matches, :contester2_id
remove_index :matches, :referee_id
remove_index :matches, :stream_id
remove_index :matches, :map1_id
remove_index :matches, :contest_id
remove_index :matches, :motm_id
remove_index :matches, :map2_id
remove_index :matches, :challenge_id
remove_index :matches, :demo_id
remove_index :matches, :week_id
remove_index :matches, :hltv_id
remove_index :messages, :column => [:sender_id, :sender_type]
remove_index :messages, :column => [:recipient_id, :recipient_type]
remove_index :watchers, :movie_id
remove_index :watchers, :user_id
remove_index :comments, :user_id
remove_index :contests, :rules_id
remove_index :contests, :demos_id
remove_index :contests, :winner_id
remove_index :gathers, :server_id
remove_index :gathers, :captain1_id
remove_index :gathers, :map1_id
remove_index :gathers, :captain2_id
remove_index :gathers, :map2_id
remove_index :groups, :founder_id
remove_index :rounders, :round_id
remove_index :rounders, :team_id
remove_index :rounders, :user_id
remove_index :teamers, :user_id
remove_index :teamers, :team_id
remove_index :votes, :column => [:votable_id, :votable_type]
remove_index :votes, :user_id
remove_index :predictions, :match_id
remove_index :predictions, :user_id
remove_index :shoutmsgs, :user_id
remove_index :topics, :user_id
remove_index :contests_maps, :column => [:map_id, :contest_id]
remove_index :contests_maps, :column => [:contest_id, :map_id]
remove_index :matchers, :match_id
remove_index :matchers, :contester_id
remove_index :matchers, :user_id
remove_index :data_files, :related_id
remove_index :data_files, :directory_id
remove_index :data_files, :article_id
remove_index :articles, :category_id
remove_index :articles, :user_id
remove_index :forums, :category_id
remove_index :groupers, :group_id
remove_index :movies, :match_id
remove_index :movies, :preview_id
remove_index :movies, :user_id
remove_index :bans, :server_id
remove_index :bans, :user_id
remove_index :issues, :assigned_id
remove_index :issues, :category_id
remove_index :issues, :author_id
remove_index :logs, :target_id
remove_index :logs, :server_id
remove_index :logs, :round_id
remove_index :logs, :log_file_id
remove_index :logs, :details_id
remove_index :logs, :actor_id
remove_index :pcws, :user_id
remove_index :pcws, :team_id
remove_index :posts, :topic_id
remove_index :posts, :user_id
remove_index :users, :team_id
remove_index :admin_requests, :server_id
remove_index :admin_requests, :user_id
remove_index :challenges, :server_id
remove_index :challenges, :contester1_id
remove_index :challenges, :contester2_id
remove_index :challenges, :map1_id
remove_index :challenges, :map2_id
remove_index :challenges, :user_id
remove_index :forumers, :group_id
remove_index :gather_maps, :map_id
remove_index :gather_maps, :gather_id
remove_index :polls, :user_id
remove_index :rounds, :map_id
remove_index :rounds, :team1_id
remove_index :rounds, :server_id
remove_index :rounds, :match_id
remove_index :rounds, :team2_id
remove_index :rounds, :commander_id
remove_index :servers, :match_id
remove_index :servers, :default_id
remove_index :servers, :user_id
remove_index :weeks, :map1_id
remove_index :weeks, :contest_id
remove_index :weeks, :map2_id
remove_index :log_files, :server_id
end
end

View file

@ -0,0 +1,10 @@
class AddMovieCategory < ActiveRecord::Migration
def self.up
change_table :movies do |m|
m.integer :category_id
end
end
def self.down
end
end

View file

@ -0,0 +1,29 @@
class AddMovieCategory2 < ActiveRecord::Migration
def self.up
long = Category.new
long.name = "Full-Length"
long.domain = Category::DOMAIN_MOVIES
long.save
short = Category.new
short.name = "Shorts"
short.domain = Category::DOMAIN_MOVIES
short.save
mock = Category.new
mock.name = "Mock-ups"
mock.domain = Category::DOMAIN_MOVIES
mock.save
Movie.all.each do |m|
if m.length and m.length < 180
m.category = short
m.save
elsif m.length and m.length >= 180
m.category = long
m.save
end
end
end
def self.down
end
end

View file

@ -0,0 +1,15 @@
class GatherLocks < ActiveRecord::Migration
def self.up
# change_table :gatherers do |g|
# g.integer :lock_version, :default => 0
# end
# change_table :gathers do |g|
# g.integer :lock_version, :default => 0
# end
end
def self.down
# remove_column :gatherers, :lock_version
# remove_column :gathers, :lock_version
end
end

View file

@ -0,0 +1,11 @@
class AddMoreIndexes < ActiveRecord::Migration
def self.up
add_index :pcws, :match_time
add_index :movies, :status
add_index :gatherers, :gather_id
add_index :comments, [:commentable_type, :id]
end
def self.down
end
end

View file

@ -0,0 +1,12 @@
class AddRecordable < ActiveRecord::Migration
def self.up
change_table :servers do |m|
m.remove :match_id
m.string :recordable_type
m.integer :recordable_id
end
end
def self.down
end
end

View file

@ -0,0 +1,14 @@
class CreateGatherServers < ActiveRecord::Migration
def self.up
create_table :gather_servers do |t|
t.references :gather
t.references :server
t.integer :votes
t.timestamps
end
end
def self.down
drop_table :gather_servers
end
end

View file

@ -0,0 +1,15 @@
class CreateDeleteds < ActiveRecord::Migration
def self.up
create_table :deleteds do |t|
t.integer :deletable_id
t.string :deletable_type
t.references :user
t.text :reason
t.timestamps
end
end
def self.down
drop_table :deleteds
end
end

View file

@ -0,0 +1,10 @@
class AddRelatedDeletion < ActiveRecord::Migration
def self.up
change_table :deleteds do |d|
d.integer :related_id
end
end
def self.down
end
end

View file

@ -0,0 +1,22 @@
class CreateFirms < ActiveRecord::Migration
def self.up
create_table :firms do |t|
t.string :name
t.string :y_code
t.string :email
t.string :website
t.string :phone
t.string :address
t.integer :zipcode
t.string :town
t.integer :owner
t.string :opentime
t.timestamps
end
end
def self.down
drop_table :firms
end
end

View file

@ -0,0 +1,22 @@
class ChangeImages < ActiveRecord::Migration
def up
Profile.transaction do
Profile.where("avatar IS NOT NULL").each do |p|
Profile.update_all(["avatar = ?", "#{p.id}#{File.extname(p.avatar.to_s)}"], "id = #{p.id}") if p.avatar and p.avatar.to_s
end
end
Movie.transaction do
Movie.where("picture IS NOT NULL").each do |p|
Movie.update_all(["picture = ?", "#{p.id}#{File.extname(p.picture.to_s)}"], "id = #{p.id}") if p.picture and p.picture.to_s
end
end
Team.transaction do
Team.where("logo IS NOT NULL").each do |p|
Team.update_all(["logo = ?", "#{p.id}#{File.extname(p.logo.to_s)}"], "id = #{p.id}") if p.logo and p.logo.to_s
end
end
end
def down
end
end

View file

@ -0,0 +1,10 @@
class AddNs2 < ActiveRecord::Migration
def up
change_table :gathers do |t|
t.references :category
end
end
def down
end
end

View file

@ -0,0 +1,28 @@
class AddNs2Maps < ActiveRecord::Migration
def up
Gather.all.each do |g|
g.update_attribute :category_id, 44
end
change_table :servers do |s|
s.references :category
end
Server.all.each do |s|
s.update_attribute :category_id, 44
end
change_table :maps do |m|
m.references :category
end
Map.all.each do |s|
s.update_attribute :category_id, 44
end
end
def down
change_table :servers do |s|
s.remove :category_id
end
change_table :maps do |s|
s.remove :category_id
end
end
end

View file

@ -0,0 +1,10 @@
class BigSession < ActiveRecord::Migration
def up
change_table :sessions do |t|
t.change :data, :longtext
end
end
def down
end
end

920
db/schema.rb Normal file
View file

@ -0,0 +1,920 @@
# 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 => 20120122001951) do
create_table "admin_requests", :force => true do |t|
t.string "addr"
t.string "pwd"
t.integer "server_id"
t.string "player"
t.integer "user_id"
t.string "msg"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "admin_requests", ["server_id"], :name => "index_admin_requests_on_server_id"
add_index "admin_requests", ["user_id"], :name => "index_admin_requests_on_user_id"
create_table "article_versions", :force => true do |t|
t.integer "article_id"
t.integer "version"
t.string "title"
t.text "text"
t.datetime "created_at"
t.datetime "updated_at"
t.text "text_parsed"
t.integer "text_coding", :default => 0, :null => false
end
add_index "article_versions", ["article_id"], :name => "index_article_versions_on_article_id"
create_table "articles", :force => true do |t|
t.string "title"
t.integer "status", :null => false
t.integer "category_id"
t.text "text"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "version"
t.text "text_parsed"
t.integer "text_coding", :default => 0, :null => false
end
add_index "articles", ["category_id"], :name => "index_articles_on_category_id"
add_index "articles", ["created_at", "status"], :name => "index_articles_on_created_at_and_status"
add_index "articles", ["created_at"], :name => "index_articles_on_created_at"
add_index "articles", ["user_id"], :name => "index_articles_on_user_id"
create_table "bans", :force => true do |t|
t.string "steamid"
t.integer "user_id"
t.string "addr"
t.integer "server_id"
t.datetime "expiry"
t.string "reason"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "ban_type"
t.string "ip"
end
add_index "bans", ["server_id"], :name => "index_bans_on_server_id"
add_index "bans", ["user_id"], :name => "index_bans_on_user_id"
create_table "bracketers", :force => true do |t|
t.integer "bracket_id"
t.integer "column"
t.integer "row"
t.integer "match_id"
t.integer "team_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "bracketers", ["match_id"], :name => "index_bracketers_on_match_id"
add_index "bracketers", ["team_id"], :name => "index_bracketers_on_team_id"
create_table "brackets", :force => true do |t|
t.integer "contest_id"
t.integer "slots"
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
end
add_index "brackets", ["contest_id"], :name => "index_brackets_on_contest_id"
create_table "categories", :force => true do |t|
t.string "name"
t.integer "sort"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "domain"
end
add_index "categories", ["domain"], :name => "index_categories_on_domain"
add_index "categories", ["sort"], :name => "index_categories_on_sort"
create_table "challenges", :force => true do |t|
t.integer "contester1_id"
t.integer "contester2_id"
t.datetime "match_time"
t.datetime "default_time"
t.boolean "mandatory"
t.integer "server_id"
t.integer "user_id"
t.string "details"
t.string "response"
t.datetime "created_at"
t.datetime "updated_at"
t.string "map1_id"
t.string "map2_id"
t.integer "status", :default => 0, :null => false
end
add_index "challenges", ["contester1_id"], :name => "index_challenges_on_contester1_id"
add_index "challenges", ["contester2_id"], :name => "index_challenges_on_contester2_id"
add_index "challenges", ["map1_id"], :name => "index_challenges_on_map1_id"
add_index "challenges", ["map2_id"], :name => "index_challenges_on_map2_id"
add_index "challenges", ["server_id"], :name => "index_challenges_on_server_id"
add_index "challenges", ["user_id"], :name => "index_challenges_on_user_id"
create_table "comments", :force => true do |t|
t.text "text"
t.integer "user_id"
t.string "commentable_type"
t.integer "commentable_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "text_parsed"
end
add_index "comments", ["commentable_type", "commentable_id"], :name => "index_comments_on_commentable_type_and_commentable_id"
add_index "comments", ["commentable_type", "id"], :name => "index_comments_on_commentable_type_and_id"
add_index "comments", ["commentable_type"], :name => "index_comments_on_commentable_type"
add_index "comments", ["user_id"], :name => "index_comments_on_user_id"
create_table "contesters", :force => true do |t|
t.integer "team_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "score", :default => 0, :null => false
t.integer "win", :default => 0, :null => false
t.integer "loss", :default => 0, :null => false
t.integer "draw", :default => 0, :null => false
t.integer "contest_id"
t.integer "trend", :null => false
t.integer "extra", :null => false
t.boolean "active", :default => true, :null => false
end
add_index "contesters", ["contest_id"], :name => "index_contesters_on_contest_id"
add_index "contesters", ["team_id"], :name => "index_contesters_on_team_id"
create_table "contests", :force => true do |t|
t.string "name"
t.datetime "start"
t.datetime "end"
t.integer "status"
t.datetime "created_at"
t.datetime "updated_at"
t.time "default_time"
t.integer "contest_type", :default => 0, :null => false
t.integer "winner_id"
t.integer "demos_id"
t.string "short_name"
t.integer "weight"
t.integer "modulus_base"
t.float "modulus_even"
t.float "modulus_3to1"
t.float "modulus_4to0"
t.integer "rules_id"
end
add_index "contests", ["demos_id"], :name => "index_contests_on_demos_id"
add_index "contests", ["rules_id"], :name => "index_contests_on_rules_id"
add_index "contests", ["status"], :name => "index_contests_on_status"
add_index "contests", ["winner_id"], :name => "index_contests_on_winner_id"
create_table "contests_maps", :id => false, :force => true do |t|
t.integer "contest_id"
t.integer "map_id"
end
add_index "contests_maps", ["contest_id", "map_id"], :name => "index_contests_maps_on_contest_id_and_map_id"
add_index "contests_maps", ["map_id", "contest_id"], :name => "index_contests_maps_on_map_id_and_contest_id"
create_table "data_files", :force => true do |t|
t.string "name"
t.string "description"
t.string "path"
t.integer "size", :null => false
t.string "md5"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "directory_id"
t.integer "related_id"
t.integer "article_id"
end
add_index "data_files", ["article_id"], :name => "index_data_files_on_article_id"
add_index "data_files", ["directory_id"], :name => "index_data_files_on_directory_id"
add_index "data_files", ["related_id"], :name => "index_data_files_on_related_id"
create_table "deleteds", :force => true do |t|
t.integer "deletable_id"
t.string "deletable_type"
t.integer "user_id"
t.text "reason"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "related_id"
end
create_table "directories", :force => true do |t|
t.string "name"
t.string "description"
t.string "path"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "parent_id"
t.boolean "hidden", :default => false, :null => false
end
add_index "directories", ["parent_id"], :name => "index_directories_on_parent_id"
create_table "firms", :force => true do |t|
t.string "name"
t.string "y_code"
t.string "email"
t.string "website"
t.string "phone"
t.string "address"
t.integer "zipcode"
t.string "town"
t.integer "owner"
t.string "opentime"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "forumers", :force => true do |t|
t.integer "forum_id"
t.integer "group_id"
t.integer "access"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "forums", :force => true do |t|
t.string "title"
t.string "description"
t.integer "category_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "position"
end
add_index "forums", ["category_id"], :name => "index_forums_on_category_id"
create_table "gather_maps", :force => true do |t|
t.integer "gather_id"
t.integer "map_id"
t.integer "votes"
end
add_index "gather_maps", ["gather_id"], :name => "index_gather_maps_on_gather_id"
add_index "gather_maps", ["map_id"], :name => "index_gather_maps_on_map_id"
create_table "gather_servers", :force => true do |t|
t.integer "gather_id"
t.integer "server_id"
t.integer "votes"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "gatherers", :force => true do |t|
t.integer "user_id"
t.integer "gather_id"
t.integer "team"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "votes", :default => 0, :null => false
end
add_index "gatherers", ["gather_id"], :name => "index_gatherers_on_gather_id"
add_index "gatherers", ["updated_at", "gather_id"], :name => "index_gatherers_on_updated_at_and_gather_id"
add_index "gatherers", ["user_id"], :name => "index_gatherers_on_user_id"
create_table "gathers", :force => true do |t|
t.integer "status"
t.integer "captain1_id"
t.integer "captain2_id"
t.integer "map1_id"
t.integer "map2_id"
t.integer "server_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "turn"
t.datetime "lastpick1"
t.datetime "lastpick2"
t.integer "votes", :default => 0, :null => false
t.integer "category_id"
end
add_index "gathers", ["captain1_id"], :name => "index_gathers_on_captain1_id"
add_index "gathers", ["captain2_id"], :name => "index_gathers_on_captain2_id"
add_index "gathers", ["map1_id"], :name => "index_gathers_on_map1_id"
add_index "gathers", ["map2_id"], :name => "index_gathers_on_map2_id"
add_index "gathers", ["server_id"], :name => "index_gathers_on_server_id"
create_table "gathers_users", :id => false, :force => true do |t|
t.integer "gather_id", :null => false
t.integer "user_id", :null => false
end
create_table "groupers", :force => true do |t|
t.integer "group_id"
t.integer "user_id"
t.string "task"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "groupers", ["group_id"], :name => "index_groupers_on_group_id"
add_index "groupers", ["user_id"], :name => "index_groupers_on_user_id"
create_table "groups", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "founder_id"
end
add_index "groups", ["founder_id"], :name => "index_groups_on_founder_id"
create_table "groups_users", :id => false, :force => true do |t|
t.integer "group_id", :null => false
t.integer "user_id", :null => false
end
create_table "issues", :force => true do |t|
t.string "title"
t.integer "status"
t.integer "assigned_id"
t.integer "category_id"
t.text "text"
t.integer "author_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "solution"
t.text "text_parsed"
end
add_index "issues", ["assigned_id"], :name => "index_issues_on_assigned_id"
add_index "issues", ["author_id"], :name => "index_issues_on_author_id"
add_index "issues", ["category_id"], :name => "index_issues_on_category_id"
create_table "locks", :force => true do |t|
t.integer "lockable_id"
t.string "lockable_type"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "locks", ["lockable_id", "lockable_type"], :name => "index_locks_on_lockable_id_and_lockable_type"
create_table "log_events", :force => true do |t|
t.string "name"
t.string "description"
t.integer "team"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "log_files", :force => true do |t|
t.string "name"
t.string "md5"
t.integer "size"
t.integer "server_id"
t.datetime "updated_at"
end
add_index "log_files", ["server_id"], :name => "index_log_files_on_server_id"
create_table "logs", :force => true do |t|
t.integer "server_id"
t.text "text"
t.integer "domain"
t.datetime "created_at"
t.integer "round_id"
t.string "details"
t.integer "actor_id"
t.integer "target_id"
t.string "specifics1"
t.string "specifics2"
t.integer "log_file_id"
end
add_index "logs", ["actor_id"], :name => "index_logs_on_actor_id"
add_index "logs", ["log_file_id"], :name => "index_logs_on_log_file_id"
add_index "logs", ["round_id"], :name => "index_logs_on_round_id"
add_index "logs", ["server_id"], :name => "index_logs_on_server_id"
add_index "logs", ["target_id"], :name => "index_logs_on_target_id"
create_table "maps", :force => true do |t|
t.string "name"
t.string "download"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "deleted", :default => false, :null => false
t.string "picture"
t.integer "category_id"
end
create_table "matchers", :force => true do |t|
t.integer "match_id", :null => false
t.integer "user_id", :null => false
t.integer "contester_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "merc", :null => false
end
add_index "matchers", ["contester_id"], :name => "index_matchers_on_contester_id"
add_index "matchers", ["match_id"], :name => "index_matchers_on_match_id"
add_index "matchers", ["user_id"], :name => "index_matchers_on_user_id"
create_table "matches", :force => true do |t|
t.integer "contester1_id"
t.integer "contester2_id"
t.integer "score1"
t.integer "score2"
t.datetime "match_time"
t.integer "challenge_id"
t.integer "contest_id"
t.text "report"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "map1_id"
t.integer "map2_id"
t.integer "server_id"
t.integer "motm_id"
t.integer "demo_id"
t.integer "week_id"
t.integer "referee_id"
t.boolean "forfeit"
t.integer "diff"
t.integer "points1"
t.integer "points2"
t.integer "hltv_id"
end
add_index "matches", ["challenge_id"], :name => "index_matches_on_challenge_id"
add_index "matches", ["contest_id"], :name => "index_matches_on_contest_id"
add_index "matches", ["contester1_id"], :name => "index_matches_on_contester1_id"
add_index "matches", ["contester2_id"], :name => "index_matches_on_contester2_id"
add_index "matches", ["demo_id"], :name => "index_matches_on_demo_id"
add_index "matches", ["hltv_id"], :name => "index_matches_on_hltv_id"
add_index "matches", ["map1_id"], :name => "index_matches_on_map1_id"
add_index "matches", ["map2_id"], :name => "index_matches_on_map2_id"
add_index "matches", ["match_time"], :name => "index_matches_on_match_time"
add_index "matches", ["motm_id"], :name => "index_matches_on_motm_id"
add_index "matches", ["referee_id"], :name => "index_matches_on_referee_id"
add_index "matches", ["score1", "score2"], :name => "index_matches_on_score1_and_score2"
add_index "matches", ["server_id"], :name => "index_matches_on_server_id"
add_index "matches", ["week_id"], :name => "index_matches_on_week_id"
create_table "messages", :force => true do |t|
t.string "sender_type"
t.integer "sender_id"
t.string "recipient_type"
t.integer "recipient_id"
t.string "title"
t.text "text"
t.datetime "created_at"
t.datetime "updated_at"
t.text "text_parsed"
end
add_index "messages", ["recipient_id", "recipient_type"], :name => "index_messages_on_recipient_id_and_recipient_type"
add_index "messages", ["sender_id", "sender_type"], :name => "index_messages_on_sender_id_and_sender_type"
create_table "movies", :force => true do |t|
t.string "name"
t.string "content"
t.string "format"
t.integer "user_id"
t.integer "file_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "picture"
t.integer "preview_id"
t.integer "length"
t.integer "match_id"
t.integer "status"
t.integer "category_id"
end
add_index "movies", ["file_id"], :name => "index_movies_on_file_id"
add_index "movies", ["match_id"], :name => "index_movies_on_match_id"
add_index "movies", ["preview_id"], :name => "index_movies_on_preview_id"
add_index "movies", ["status"], :name => "index_movies_on_status"
add_index "movies", ["user_id"], :name => "index_movies_on_user_id"
create_table "nodes", :force => true do |t|
t.string "name"
t.integer "foreign_key"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "options", :force => true do |t|
t.string "option"
t.integer "poll_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "votes", :default => 0, :null => false
end
add_index "options", ["poll_id"], :name => "index_options_on_poll_id"
create_table "pcws", :force => true do |t|
t.integer "team_id"
t.integer "user_id"
t.datetime "match_time"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "pcws", ["match_time"], :name => "index_pcws_on_match_time"
add_index "pcws", ["team_id"], :name => "index_pcws_on_team_id"
add_index "pcws", ["user_id"], :name => "index_pcws_on_user_id"
create_table "polls", :force => true do |t|
t.string "question"
t.datetime "end_date"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "votes", :default => 0, :null => false
end
add_index "polls", ["user_id"], :name => "index_polls_on_user_id"
create_table "posts", :force => true do |t|
t.text "text"
t.integer "topic_id"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "text_parsed"
end
add_index "posts", ["topic_id"], :name => "index_posts_on_topic_id"
add_index "posts", ["user_id"], :name => "index_posts_on_user_id"
create_table "predictions", :force => true do |t|
t.integer "match_id"
t.integer "user_id"
t.integer "score1"
t.integer "score2"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "result"
end
add_index "predictions", ["match_id"], :name => "index_predictions_on_match_id"
add_index "predictions", ["user_id"], :name => "index_predictions_on_user_id"
create_table "profiles", :force => true do |t|
t.integer "user_id"
t.string "msn"
t.string "icq"
t.string "irc"
t.string "web"
t.string "town"
t.string "singleplayer"
t.string "multiplayer"
t.string "food"
t.string "beverage"
t.string "hobby"
t.string "music"
t.string "book"
t.string "movie"
t.string "tvseries"
t.string "res"
t.string "sensitivity"
t.string "monitor_hz"
t.string "scripts"
t.string "cpu"
t.string "gpu"
t.string "ram"
t.string "psu"
t.string "motherboard"
t.string "soundcard"
t.string "hdd"
t.string "case"
t.string "monitor"
t.string "mouse"
t.string "mouse_pad"
t.string "keyboard"
t.string "head_phones"
t.string "speakers"
t.text "achievements"
t.datetime "updated_at"
t.string "signature"
t.string "avatar"
t.string "clan_search"
t.boolean "notify_news"
t.boolean "notify_articles"
t.boolean "notify_movies"
t.boolean "notify_gather"
t.boolean "notify_own_match"
t.boolean "notify_any_match"
t.boolean "notify_pms", :default => true, :null => false
t.boolean "notify_challenge", :default => true, :null => false
t.string "steam_profile"
t.string "achievements_parsed"
t.string "signature_parsed"
end
add_index "profiles", ["user_id"], :name => "index_profiles_on_user_id"
create_table "rates", :force => true do |t|
t.integer "score"
end
create_table "ratings", :force => true do |t|
t.integer "user_id"
t.integer "rate_id"
t.integer "rateable_id"
t.string "rateable_type", :limit => 32
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "ratings", ["rate_id"], :name => "index_ratings_on_rate_id"
add_index "ratings", ["rateable_id", "rateable_type"], :name => "index_ratings_on_rateable_id_and_rateable_type"
create_table "readings", :force => true do |t|
t.string "readable_type"
t.integer "readable_id"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "readings", ["readable_type", "readable_id"], :name => "index_readings_on_readable_type_and_readable_id"
add_index "readings", ["user_id", "readable_id", "readable_type"], :name => "index_readings_on_user_id_and_readable_id_and_readable_type"
add_index "readings", ["user_id"], :name => "index_readings_on_user_id"
create_table "rounders", :force => true do |t|
t.integer "round_id"
t.integer "user_id"
t.integer "team"
t.string "roles"
t.integer "kills"
t.integer "deaths"
t.string "name"
t.string "steamid"
t.integer "team_id"
end
add_index "rounders", ["round_id"], :name => "index_rounders_on_round_id"
add_index "rounders", ["team_id"], :name => "index_rounders_on_team_id"
add_index "rounders", ["user_id"], :name => "index_rounders_on_user_id"
create_table "rounds", :force => true do |t|
t.integer "server_id"
t.datetime "start"
t.datetime "end"
t.integer "winner"
t.integer "match_id"
t.integer "commander_id"
t.integer "team1_id"
t.integer "team2_id"
t.string "map_name"
t.integer "map_id"
end
add_index "rounds", ["commander_id"], :name => "index_rounds_on_commander_id"
add_index "rounds", ["map_id"], :name => "index_rounds_on_map_id"
add_index "rounds", ["match_id"], :name => "index_rounds_on_match_id"
add_index "rounds", ["server_id"], :name => "index_rounds_on_server_id"
add_index "rounds", ["team1_id"], :name => "index_rounds_on_team1_id"
add_index "rounds", ["team2_id"], :name => "index_rounds_on_team2_id"
create_table "server_versions", :force => true do |t|
t.integer "server_id"
t.integer "version"
t.datetime "created_at"
t.datetime "updated_at"
t.string "map"
t.integer "players"
t.integer "max_players"
t.string "ping"
end
add_index "server_versions", ["server_id"], :name => "index_server_versions_on_server_id"
create_table "servers", :force => true do |t|
t.string "name"
t.string "description"
t.string "dns"
t.string "ip"
t.string "port"
t.string "rcon"
t.string "password"
t.string "irc"
t.integer "user_id"
t.boolean "official"
t.datetime "created_at"
t.datetime "updated_at"
t.string "map"
t.integer "players"
t.integer "max_players"
t.string "ping"
t.integer "version"
t.integer "domain", :default => 0, :null => false
t.string "reservation"
t.string "recording"
t.datetime "idle"
t.integer "default_id"
t.boolean "active", :default => true, :null => false
t.string "recordable_type"
t.integer "recordable_id"
t.integer "category_id"
end
add_index "servers", ["default_id"], :name => "index_servers_on_default_id"
add_index "servers", ["players", "domain"], :name => "index_servers_on_players_and_domain"
add_index "servers", ["user_id"], :name => "index_servers_on_user_id"
create_table "sessions", :force => true do |t|
t.string "session_id", :null => false
t.text "data", :limit => 2147483647
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
create_table "shoutmsgs", :force => true do |t|
t.integer "user_id"
t.string "text"
t.datetime "created_at"
t.datetime "updated_at"
t.string "shoutable_type"
t.integer "shoutable_id"
end
add_index "shoutmsgs", ["shoutable_type", "shoutable_id"], :name => "index_shoutmsgs_on_shoutable_type_and_shoutable_id"
add_index "shoutmsgs", ["user_id"], :name => "index_shoutmsgs_on_user_id"
create_table "sites", :force => true do |t|
t.string "name"
t.string "url"
t.integer "category_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "favicon"
end
add_index "sites", ["category_id"], :name => "index_sites_on_category_id"
add_index "sites", ["created_at"], :name => "index_sites_on_created_at"
create_table "teamers", :force => true do |t|
t.integer "team_id", :null => false
t.integer "user_id", :null => false
t.string "comment"
t.integer "rank", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "teamers", ["team_id"], :name => "index_teamers_on_team_id"
add_index "teamers", ["user_id"], :name => "index_teamers_on_user_id"
create_table "teams", :force => true do |t|
t.string "name"
t.string "irc"
t.string "web"
t.string "tag"
t.string "country"
t.string "comment"
t.datetime "created_at"
t.datetime "updated_at"
t.string "logo"
t.integer "founder_id"
t.boolean "active", :default => true, :null => false
t.string "recruiting"
end
add_index "teams", ["founder_id"], :name => "index_teams_on_founder_id"
create_table "topics", :force => true do |t|
t.string "title"
t.integer "user_id"
t.integer "forum_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "state", :default => 0, :null => false
end
add_index "topics", ["forum_id"], :name => "index_topics_on_forum_id"
add_index "topics", ["user_id"], :name => "index_topics_on_user_id"
create_table "tweets", :force => true do |t|
t.string "msg"
t.string "link"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "tweets", ["created_at"], :name => "index_tweets_on_created_at"
create_table "user_versions", :force => true do |t|
t.integer "user_id"
t.integer "version"
t.string "steamid"
t.string "username"
t.string "lastip"
t.datetime "updated_at"
end
add_index "user_versions", ["steamid"], :name => "index_user_versions_on_steamid"
add_index "user_versions", ["user_id"], :name => "index_user_versions_on_user_id"
create_table "users", :force => true do |t|
t.string "username"
t.string "password"
t.string "firstname"
t.string "lastname"
t.string "email"
t.string "steamid"
t.integer "team_id"
t.datetime "lastvisit"
t.datetime "created_at"
t.datetime "updated_at"
t.string "lastip"
t.string "country"
t.date "birthdate"
t.string "time_zone"
t.integer "version"
t.boolean "public_email", :default => false, :null => false
end
add_index "users", ["team_id"], :name => "index_users_on_team_id"
create_table "versions", :force => true do |t|
t.string "item_type", :null => false
t.integer "item_id", :null => false
t.string "event", :null => false
t.string "whodunnit"
t.text "object"
t.datetime "created_at"
end
add_index "versions", ["item_type", "item_id"], :name => "index_versions_on_item_type_and_item_id"
create_table "view_counts", :force => true do |t|
t.integer "viewable_id"
t.string "viewable_type"
t.string "ip_address"
t.boolean "logged_in"
t.date "created_at"
end
add_index "view_counts", ["viewable_type", "viewable_id"], :name => "index_view_counts_on_viewable_type_and_viewable_id"
create_table "votes", :force => true do |t|
t.integer "user_id"
t.integer "votable_id"
t.integer "poll_id"
t.string "votable_type"
end
add_index "votes", ["user_id"], :name => "index_votes_on_user_id"
add_index "votes", ["votable_id", "votable_type"], :name => "index_votes_on_votable_id_and_votable_type"
create_table "watchers", :force => true do |t|
t.integer "user_id"
t.integer "movie_id"
t.boolean "banned", :default => false, :null => false
t.datetime "updated_at"
end
add_index "watchers", ["movie_id"], :name => "index_watchers_on_movie_id"
add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id"
create_table "weeks", :force => true do |t|
t.string "name"
t.date "start_date"
t.integer "contest_id"
t.integer "map1_id"
t.integer "map2_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "weeks", ["contest_id"], :name => "index_weeks_on_contest_id"
add_index "weeks", ["map1_id"], :name => "index_weeks_on_map1_id"
add_index "weeks", ["map2_id"], :name => "index_weeks_on_map2_id"
end

69
db/seeds.rb Normal file
View file

@ -0,0 +1,69 @@
# Base User
User.create!(username: "admin", email: "admin@ensl.org", raw_password: "developer", steamid: "0:1:23456789")
# Base User Profile
Profile.create!(user: User.first)
# Base User Groups
Group.create!(id: Group::ADMINS, name: "Admins", founder: User.first)
Group.create!(id: Group::REFEREES, name: "Referees", founder: User.first)
Group.create!(id: Group::MOVIES, name: "Movies", founder: User.first)
Group.create!(id: Group::DONORS, name: "Donors", founder: User.first)
Group.create!(id: Group::MOVIEMAKERS, name: "Movie Makers", founder: User.first)
Group.create!(id: Group::SHOUTCASTERS, name: "Casters", founder: User.first)
Group.create!(id: Group::CHAMPIONS, name: "Champions", founder: User.first)
Group.create!(id: Group::PREDICTORS, name: "Predictors", founder: User.first)
Group.create!(id: Group::STAFF, name: "Staff", founder: User.first)
# Group Association
Grouper.create!(group_id: Group::ADMINS, user_id: User.first.id)
# Base Categories
Category.create!(name: "League", domain: Category::DOMAIN_NEWS)
Category.create!(name: "ENSL Rules", domain: Category::DOMAIN_ARTICLES)
Category.create!(name: "ENSL Guides", domain: Category::DOMAIN_ARTICLES)
Category.create!(name: "Website", domain: Category::DOMAIN_ISSUES)
Category.create!(name: "ENSL Plugin", domain: Category::DOMAIN_ISSUES)
Category.create!(name: "League", domain: Category::DOMAIN_ISSUES)
Category.create!(name: "Regional", domain: Category::DOMAIN_SITES)
Category.create!(name: "Public", domain: Category::DOMAIN_SITES)
Category.create!(name: "Competetive", domain: Category::DOMAIN_SITES)
Category.create!(name: "Official", domain: Category::DOMAIN_SITES)
Category.create!(name: "General", domain: Category::DOMAIN_FORUMS)
Category.create!(name: "ENSL", domain: Category::DOMAIN_FORUMS)
Category.create!(name: "Full Length", domain: Category::DOMAIN_MOVIES)
Category.create!(name: "Shorts", domain: Category::DOMAIN_MOVIES)
Category.create!(name: "Mock-ups", domain: Category::DOMAIN_MOVIES)
Category.create!(name: "NS1", domain: Category::DOMAIN_GAMES)
Category.create!(name: "NS2", domain: Category::DOMAIN_GAMES)
# Base Articles
Article.create!(title: "ENSL Developer", status: Article::STATUS_PUBLISHED, category_id: Category.first.id, text: "Welcome to ENSL", user: User.first)
Article.create!(id: Article::RULES, title: "Rules", status: Article::STATUS_PUBLISHED, category_id: Category.where(name: "ENSL Rules").first.id, text: "ENSL Rules", user: User.first)
Article.create!(id: Article::HISTORY, title: "History", status: Article::STATUS_PUBLISHED, category_id: Category.where(name: "ENSL Rules").first.id, text: "ENSL History", user: User.first)
Article.create!(id: Article::HOF, title: "Hall of Fame", status: Article::STATUS_PUBLISHED, category_id: Category.where(name: "ENSL Rules").first.id, text: "Hall of Fame", user: User.first)
# Base Maps
Map.create!(name: "ns_ensl_developer", category_id: Category.where(name: "NS1").first.id)
Map.create!(name: "ns2_ensl_developer", category_id: Category.where(name: "NS2").first.id)
# Base Gather types for each Game
Category.where(domain: Category::DOMAIN_GAMES).each do |game|
Gather.create!(id: game.id, status: Gather::STATE_RUNNING, category_id: game.id)
end
# Example Poll
Poll.create!(question: "ENSL Test Poll", user: User.first)
# Example Options
Option.create!(option: "Option 1", poll: Poll.first)
Option.create!(option: "Option 2", poll: Poll.first)
# Base Forums
Forum.create!(title: "General Discussion", description: "Anything that doesn't belong in the other forums", catrgory_id: Category.where(domain: Category::DOMAIN_FORUMS).first)
# Example Topic
Topic.create!(title: "Hello World!", forum_id: Forum.first.id, user: User.first, first_post: "Hello World!")
# Example Team
Team.create!(name: "ENSL", irc: "#ensl", web: "http://ensl.org", tag: "[ENSL]", country: "EU", comment: "ENSL Team", founder: User.first)