Skip to content

Commit

Permalink
Add new table migrations for tags, jobs, resumes, categories, skills
Browse files Browse the repository at this point in the history
  • Loading branch information
Druotic authored and Shanil Puri committed Sep 22, 2014
1 parent e9b94a8 commit 7391e5b
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
11 changes: 11 additions & 0 deletions db/migrate/20140921054951_create_tags.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateTags < ActiveRecord::Migration
def up
create_table :tags do |t|
t.string :name
end
end

def down
drop_table :tags
end
end
12 changes: 12 additions & 0 deletions db/migrate/20140921055840_jobs_tags.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class JobsTags < ActiveRecord::Migration
def up
create table :jobs_tags, :id=>false do |t|
t.integer :job_id
t.integer :tag_id
end
end
def down
drop table :jobs_tags
end
end

11 changes: 11 additions & 0 deletions db/migrate/20140921060728_create_categories.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateCategories < ActiveRecord::Migration
def up
create_table :categories do |t|
t.string :name
end
end

def down
drop_table :categories
end
end
17 changes: 17 additions & 0 deletions db/migrate/20140921061139_create_jobs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class CreateJobs < ActiveRecord::Migration
def up
create_table :jobs do |t|
t.integer :owner_id
t.string :title
t.string :description
t.integer :salary
t.string :location
t.integer :category_id
t.datetime :deadline
end
end

def down
drop_table :jobs
end
end
12 changes: 12 additions & 0 deletions db/migrate/20140921064720_create_resumes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateResumes < ActiveRecord::Migration
def up
create_table :resumes do |t|
t.string :title
t.string :body
end
end

def down
drop_table :resumes
end
end
11 changes: 11 additions & 0 deletions db/migrate/20140921070518_create_skills.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateSkills < ActiveRecord::Migration
def up
create_table :skills do |t|
t.string :name
end
end

def down
drop_tables :skills
end
end

0 comments on commit 7391e5b

Please sign in to comment.