first release

This commit is contained in:
jomo
2013-05-31 22:26:22 +02:00
parent 149232ec0c
commit 8921d108e2
70 changed files with 1080 additions and 85 deletions

View File

@@ -0,0 +1,16 @@
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name, :unique => true, :null => false
t.string :ign, :unique => true, :null => false
t.integer :rank, :default => 10, :null => false
t.boolean :banned, :default => false
t.string :email, :unique => true, :null => false
t.text :about
t.string :password_digest, :null => false
t.string :last_ip
t.timestamps
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateBlogposts < ActiveRecord::Migration
def change
create_table :blogposts do |t|
t.string :title
t.text :text
t.integer :user_id
t.timestamps
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.text :text
t.integer :user_id
t.integer :blogpost_id
t.timestamps
end
end
end

View File

@@ -11,6 +11,35 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 0) do
ActiveRecord::Schema.define(:version => 20130526020734) do
create_table "blogposts", :force => true do |t|
t.string "title"
t.text "text"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "comments", :force => true do |t|
t.text "text"
t.integer "user_id"
t.integer "blogpost_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "users", :force => true do |t|
t.string "name", :null => false
t.string "ign", :null => false
t.integer "rank", :default => 10, :null => false
t.boolean "banned", :default => false
t.string "email", :null => false
t.text "about"
t.string "password_digest", :null => false
t.string "last_ip"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
end

View File

@@ -1,7 +1,4 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
User.create(name: "Redstone Sheep", ign: "noobkackboon", email: "theredstonesheep@gmail.com", about: "Hi, I am the admin :)", password: "123", password_confirmation: "123")