Initial Commit
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
class CreateAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :assets do |t|
|
||||
t.string :tag
|
||||
t.string :name
|
||||
t.string :serial
|
||||
t.string :category
|
||||
t.string :make
|
||||
t.date :warranty
|
||||
t.string :password
|
||||
t.string :location
|
||||
t.string :assigned
|
||||
t.string :status
|
||||
t.datetime :verified
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :assets
|
||||
end
|
||||
end
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
class CreateComments < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :comments do |t|
|
||||
t.integer :asset_id
|
||||
t.string :commenter
|
||||
t.text :body
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :comments
|
||||
end
|
||||
end
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
class CreateSoftwares < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :softwares do |t|
|
||||
t.string :name
|
||||
t.string :key
|
||||
t.integer :asset_id
|
||||
t.date :installed
|
||||
t.string :installed_by
|
||||
t.string :modified_by
|
||||
t.string :note
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :softwares
|
||||
end
|
||||
end
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
class DeviseCreateUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table(:users) do |t|
|
||||
t.database_authenticatable :null => false
|
||||
t.confirmable
|
||||
t.recoverable
|
||||
t.rememberable
|
||||
t.trackable
|
||||
# t.lockable
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :users, :email, :unique => true
|
||||
add_index :users, :confirmation_token, :unique => true
|
||||
add_index :users, :reset_password_token, :unique => true
|
||||
# add_index :users, :unlock_token, :unique => true
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :users
|
||||
end
|
||||
end
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class AddNameToUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :users, :name, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :users, :name
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddModifiedByToAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :assets, :modified_by, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :assets, :modified_by
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddMediaLocationToSoftwares < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :softwares, :media_location, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :softwares, :media_location
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class RemoveVerifiedFromAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
remove_column :assets, :verified
|
||||
end
|
||||
|
||||
def self.down
|
||||
add_column :assets, :verified, :datetime
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddUpdatedToAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :assets, :updated, :date
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :assets, :updated
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class RemovePasswordFromAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
remove_column :assets, :password
|
||||
end
|
||||
|
||||
def self.down
|
||||
add_column :assets, :password, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class RemoveNameFromAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
remove_column :assets, :name
|
||||
end
|
||||
|
||||
def self.down
|
||||
add_column :assets, :name, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddModelToAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :assets, :model, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :assets, :model
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class RemoveNameFromSoftwares < ActiveRecord::Migration
|
||||
def self.up
|
||||
remove_column :softwares, :name
|
||||
end
|
||||
|
||||
def self.down
|
||||
add_column :softwares, :name, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
class AddCompanyVersionToSoftwares < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :softwares, :company, :string
|
||||
add_column :softwares, :version, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :softwares, :version
|
||||
remove_column :softwares, :company
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddNameToAssets < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :assets, :name, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :assets, :name
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddPlatformToSoftwares < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :softwares, :platform, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :softwares, :platform
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user