Skip to content
Permalink
Browse files

* migration for statements + statements with it's various subtypes

* updated schema
* updated .gitignore to ignore emacs temp files
* added .gitignore to tmp/ directory so that it makes it into git
  • Loading branch information...
niklas
niklas committed Nov 14, 2009
1 parent 43eac44 commit bd745b20eb60f16fc247a6cf3db00ed3e2747b5e
@@ -8,3 +8,7 @@ public/system/avatars/
/echologic.ipr
/echologic.iws
db/*.sqlite3
*~
.\#*
\#*
*\#
@@ -0,0 +1,2 @@
class Argument < Statement # abstract class
end
@@ -0,0 +1,2 @@
class ContraArgument < Argument
end
@@ -0,0 +1,2 @@
class ImprovementProposal < Proposal
end
@@ -0,0 +1,2 @@
class ProArgument < Argument
end
@@ -0,0 +1,2 @@
class Proposal < Statement
end
@@ -0,0 +1,2 @@
class Question < Statement
end
@@ -0,0 +1,8 @@
class Statement < ActiveRecord::Base
belongs_to :user
acts_as_tree

validates_presence_of :title
validates_presence_of :text
validates_presence_of :user_id
end
@@ -0,0 +1,17 @@
class CreateStatements < ActiveRecord::Migration
def self.up
create_table :statements do |t|
t.string :title
t.text :text
t.string :type
t.integer :user_id
t.boolean :activated
t.integer :parent_id
t.integer :root_id
end
end

def self.down
drop_table :statements
end
end
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20091102155547) do
ActiveRecord::Schema.define(:version => 20091114161154) do

create_table "concernments", :force => true do |t|
t.integer "user_id"
@@ -86,6 +86,16 @@
t.datetime "updated_at"
end

create_table "statements", :force => true do |t|
t.string "title"
t.text "text"
t.string "type"
t.integer "user_id"
t.boolean "activated"
t.integer "parent_id"
t.integer "root_id"
end

create_table "tags", :force => true do |t|
t.string "value"
t.datetime "created_at"
@@ -0,0 +1 @@
*

0 comments on commit bd745b2

Please sign in to comment.
You can’t perform that action at this time.