Migrations to convert data added
This commit is contained in:
parent
3b6228dc27
commit
b3dc4fb721
|
@ -1,5 +1,5 @@
|
|||
class AddPrivateToSnippets < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :snippets, :private, :boolean
|
||||
add_column :snippets, :private, :boolean, null: false, default: true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
class AddTypeValueForSnippets < ActiveRecord::Migration
|
||||
def up
|
||||
Snippet.where("project_id IS NOT NULL").update_all(type: 'ProjectSnippet')
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
10
db/schema.rb
10
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20130324172327) do
|
||||
ActiveRecord::Schema.define(:version => 20130324203535) do
|
||||
|
||||
create_table "events", :force => true do |t|
|
||||
t.string "target_type"
|
||||
|
@ -184,13 +184,13 @@ ActiveRecord::Schema.define(:version => 20130324172327) do
|
|||
create_table "snippets", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "content"
|
||||
t.integer "author_id", :null => false
|
||||
t.integer "author_id", :null => false
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.string "file_name"
|
||||
t.datetime "expires_at"
|
||||
t.boolean "private"
|
||||
t.boolean "private", :default => true, :null => false
|
||||
t.string "type"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue