Skip to content

Commit

Permalink
Merge pull request #17 from morganp/d34d0f856373878be5b2a6cb207cba70f…
Browse files Browse the repository at this point in the history
…ed563c9

Added change_column_null migration
  • Loading branch information
Jordan Byron authored and Jordan Byron committed Jun 23, 2011
2 parents 32c04fd + d34d0f8 commit b93ed78
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
19 changes: 19 additions & 0 deletions db/migrate/20110621075931_add_not_null.rb
@@ -0,0 +1,19 @@
class AddNotNull < ActiveRecord::Migration
def self.up
change_column_null :authorizations, :user_id, false
change_column_null :authorizations, :provider, false
change_column_null :authorizations, :uid, false
change_column_null :tags, :name, false
change_column_null :taggings, :article_id, false
change_column_null :taggings, :tag_id, false
end

def self.down
change_column_null :authorizations, :user_id, true
change_column_null :authorizations, :provider, true
change_column_null :authorizations, :uid, true
change_column_null :tags, :name, true
change_column_null :taggings, :article_id, true
change_column_null :taggings, :tag_id, true
end
end
14 changes: 7 additions & 7 deletions db/schema.rb
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20110618112338) do
ActiveRecord::Schema.define(:version => 20110621075931) do

create_table "articles", :force => true do |t|
t.integer "author_id"
Expand All @@ -23,22 +23,22 @@
end

create_table "authorizations", :force => true do |t|
t.integer "user_id"
t.string "provider"
t.string "uid"
t.integer "user_id", :null => false
t.string "provider", :null => false
t.string "uid", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "taggings", :force => true do |t|
t.integer "tag_id"
t.integer "article_id"
t.integer "tag_id", :null => false
t.integer "article_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "tags", :force => true do |t|
t.string "name"
t.string "name", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
Expand Down

0 comments on commit b93ed78

Please sign in to comment.