Adding resources (imported from old toolshare)
This commit is contained in:
26
db/migrate/20140209065240_create_resources.rb
Normal file
26
db/migrate/20140209065240_create_resources.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
class CreateResources < ActiveRecord::Migration
|
||||
def up
|
||||
create_table "resources", :force => true do |t|
|
||||
t.string "type"
|
||||
t.integer "owner_id"
|
||||
t.integer "category_id"
|
||||
t.string "name"
|
||||
t.string "serial"
|
||||
t.string "specs"
|
||||
t.string "status"
|
||||
t.boolean "donatable"
|
||||
t.string "picture_file_name"
|
||||
t.string "picture_content_type"
|
||||
t.integer "picture_file_size"
|
||||
t.datetime "picture_updated_at"
|
||||
t.text "notes"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "estimated_value"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :resources
|
||||
end
|
||||
end
|
||||
14
db/migrate/20140209070141_create_categories.rb
Normal file
14
db/migrate/20140209070141_create_categories.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateCategories < ActiveRecord::Migration
|
||||
def up
|
||||
create_table "resource_categories", :force => true do |t|
|
||||
t.string "name"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "parent"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :resource_categories
|
||||
end
|
||||
end
|
||||
27
db/migrate/20140209070300_create_toolshare_users.rb
Normal file
27
db/migrate/20140209070300_create_toolshare_users.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
class CreateToolshareUsers < ActiveRecord::Migration
|
||||
def up
|
||||
create_table "toolshare_users", :force => true do |t|
|
||||
t.string "email", :default => "", :null => false
|
||||
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
||||
t.string "password_salt", :default => "", :null => false
|
||||
t.string "confirmation_token"
|
||||
t.datetime "confirmed_at"
|
||||
t.datetime "confirmation_sent_at"
|
||||
t.string "reset_password_token"
|
||||
t.string "remember_token"
|
||||
t.datetime "remember_created_at"
|
||||
t.integer "sign_in_count", :default => 0
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "name"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :toolshare_users
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class ChangeResourceTypeToSuperCategory < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :resources, :type, :supercategory
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user