From 7391e5b8b985fdb55722bddc6aa0c15b9c2732a8 Mon Sep 17 00:00:00 2001 From: James Beavers Date: Sun, 21 Sep 2014 03:10:14 -0400 Subject: [PATCH] Add new table migrations for tags, jobs, resumes, categories, skills --- db/migrate/20140921054951_create_tags.rb | 11 +++++++++++ db/migrate/20140921055840_jobs_tags.rb | 12 ++++++++++++ db/migrate/20140921060728_create_categories.rb | 11 +++++++++++ db/migrate/20140921061139_create_jobs.rb | 17 +++++++++++++++++ db/migrate/20140921064720_create_resumes.rb | 12 ++++++++++++ db/migrate/20140921070518_create_skills.rb | 11 +++++++++++ 6 files changed, 74 insertions(+) create mode 100644 db/migrate/20140921054951_create_tags.rb create mode 100644 db/migrate/20140921055840_jobs_tags.rb create mode 100644 db/migrate/20140921060728_create_categories.rb create mode 100644 db/migrate/20140921061139_create_jobs.rb create mode 100644 db/migrate/20140921064720_create_resumes.rb create mode 100644 db/migrate/20140921070518_create_skills.rb diff --git a/db/migrate/20140921054951_create_tags.rb b/db/migrate/20140921054951_create_tags.rb new file mode 100644 index 0000000..eaa31cd --- /dev/null +++ b/db/migrate/20140921054951_create_tags.rb @@ -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 diff --git a/db/migrate/20140921055840_jobs_tags.rb b/db/migrate/20140921055840_jobs_tags.rb new file mode 100644 index 0000000..3e8f39d --- /dev/null +++ b/db/migrate/20140921055840_jobs_tags.rb @@ -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 + diff --git a/db/migrate/20140921060728_create_categories.rb b/db/migrate/20140921060728_create_categories.rb new file mode 100644 index 0000000..882c147 --- /dev/null +++ b/db/migrate/20140921060728_create_categories.rb @@ -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 diff --git a/db/migrate/20140921061139_create_jobs.rb b/db/migrate/20140921061139_create_jobs.rb new file mode 100644 index 0000000..3c66969 --- /dev/null +++ b/db/migrate/20140921061139_create_jobs.rb @@ -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 \ No newline at end of file diff --git a/db/migrate/20140921064720_create_resumes.rb b/db/migrate/20140921064720_create_resumes.rb new file mode 100644 index 0000000..f37d8fd --- /dev/null +++ b/db/migrate/20140921064720_create_resumes.rb @@ -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 diff --git a/db/migrate/20140921070518_create_skills.rb b/db/migrate/20140921070518_create_skills.rb new file mode 100644 index 0000000..3e3fefe --- /dev/null +++ b/db/migrate/20140921070518_create_skills.rb @@ -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