pshq_engine 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +4 -0
  5. data/README.md +39 -0
  6. data/Rakefile +1 -0
  7. data/app/models/.keep +0 -0
  8. data/app/models/ability.rb +76 -0
  9. data/app/models/alert.rb +56 -0
  10. data/app/models/asset.rb +485 -0
  11. data/app/models/asset_assignment.rb +13 -0
  12. data/app/models/asset_image.rb +9 -0
  13. data/app/models/asset_repair_request.rb +167 -0
  14. data/app/models/asset_scan.rb +87 -0
  15. data/app/models/asset_ticket.rb +3 -0
  16. data/app/models/cancellation.rb +64 -0
  17. data/app/models/candidate.rb +127 -0
  18. data/app/models/certification.rb +4 -0
  19. data/app/models/concerns/.keep +0 -0
  20. data/app/models/depreciation_setting.rb +10 -0
  21. data/app/models/dispatch.rb +3 -0
  22. data/app/models/employee.rb +22 -0
  23. data/app/models/feedback.rb +24 -0
  24. data/app/models/history_email.rb +221 -0
  25. data/app/models/importfile.rb +6 -0
  26. data/app/models/job.rb +37 -0
  27. data/app/models/jobs_users.rb +18 -0
  28. data/app/models/lateness.rb +35 -0
  29. data/app/models/location.rb +4 -0
  30. data/app/models/manufacturer.rb +4 -0
  31. data/app/models/member.rb +65 -0
  32. data/app/models/member_device.rb +4 -0
  33. data/app/models/message.rb +33 -0
  34. data/app/models/note.rb +20 -0
  35. data/app/models/notification.rb +73 -0
  36. data/app/models/notification_user.rb +4 -0
  37. data/app/models/o_auth/base.rb +27 -0
  38. data/app/models/o_auth/facebook.rb +21 -0
  39. data/app/models/o_auth/google.rb +18 -0
  40. data/app/models/organization.rb +189 -0
  41. data/app/models/plan.rb +4 -0
  42. data/app/models/project.rb +5 -0
  43. data/app/models/project_payment.rb +4 -0
  44. data/app/models/recurring_time_off.rb +4 -0
  45. data/app/models/response.rb +23 -0
  46. data/app/models/role.rb +22 -0
  47. data/app/models/schedule.rb +228 -0
  48. data/app/models/setting.rb +25 -0
  49. data/app/models/shift.rb +364 -0
  50. data/app/models/shift_off.rb +4 -0
  51. data/app/models/shift_trade.rb +43 -0
  52. data/app/models/subdomain.rb +5 -0
  53. data/app/models/swap.rb +82 -0
  54. data/app/models/task.rb +26 -0
  55. data/app/models/template.rb +59 -0
  56. data/app/models/template_asset.rb +3 -0
  57. data/app/models/timeoff.rb +101 -0
  58. data/app/models/token.rb +22 -0
  59. data/app/models/transaction.rb +2 -0
  60. data/app/models/unavailable.rb +37 -0
  61. data/app/models/user.rb +392 -0
  62. data/app/models/user_notification_setting.rb +178 -0
  63. data/app/models/user_vacation_info.rb +22 -0
  64. data/app/models/vacation.rb +24 -0
  65. data/app/models/vendor.rb +130 -0
  66. data/app/models/vendor_rating.rb +7 -0
  67. data/bin/console +14 -0
  68. data/bin/setup +7 -0
  69. data/db/migrate/20140211085026_devise_create_users.rb +58 -0
  70. data/db/migrate/20140211093822_rolify_create_roles.rb +19 -0
  71. data/db/migrate/20140211124352_create_subdomains.rb +9 -0
  72. data/db/migrate/20140211175737_devise_invitable_add_to_users.rb +24 -0
  73. data/db/migrate/20140222020040_create_schedules.rb +13 -0
  74. data/db/migrate/20140222020246_create_jobs.rb +11 -0
  75. data/db/migrate/20140222020348_create_shifts.rb +17 -0
  76. data/db/migrate/20140222020425_create_organizations.rb +19 -0
  77. data/db/migrate/20140226070901_create_plans.rb +11 -0
  78. data/db/migrate/20140302152936_create_feedbacks.rb +12 -0
  79. data/db/migrate/20140302153059_create_swaps.rb +16 -0
  80. data/db/migrate/20140302153215_create_timeoffs.rb +19 -0
  81. data/db/migrate/20140302153302_create_cancellations.rb +13 -0
  82. data/db/migrate/20140306014858_create_candidates.rb +15 -0
  83. data/db/migrate/20140314041018_create_shift_trades.rb +15 -0
  84. data/db/migrate/20140314041210_create_notes.rb +11 -0
  85. data/db/migrate/20140314041313_create_latenesses.rb +11 -0
  86. data/db/migrate/20140314041351_create_vacations.rb +11 -0
  87. data/db/migrate/20140314041440_create_user_vacation_infos.rb +11 -0
  88. data/db/migrate/20140318072438_create_jobs_users.rb +10 -0
  89. data/db/migrate/20140325151307_create_tasks.rb +16 -0
  90. data/db/migrate/20140406040247_create_mailboxer.mailboxer_engine.rb +66 -0
  91. data/db/migrate/20140406040248_add_conversation_optout.mailboxer_engine.rb +15 -0
  92. data/db/migrate/20141015085628_create_alerts.rb +14 -0
  93. data/db/migrate/20141023104634_add_disabled_to_users.rb +5 -0
  94. data/db/migrate/20141024094518_add_is_viewed_to_schedules.rb +5 -0
  95. data/db/migrate/20141027091531_add_customer_id_to_users.rb +5 -0
  96. data/db/migrate/20141029124637_create_unavailables.rb +11 -0
  97. data/db/migrate/20141029151702_create_certifications.rb +10 -0
  98. data/db/migrate/20141105091745_add_reminder_time_to_shifts.rb +5 -0
  99. data/db/migrate/20141106054916_create_certifications_users.rb +10 -0
  100. data/db/migrate/20141106100123_add_birth_date_to_users.rb +5 -0
  101. data/db/migrate/20141106134815_add_allow_rolling_v_hrs_to_organizations.rb +5 -0
  102. data/db/migrate/20141107155319_create_recurring_time_offs.rb +12 -0
  103. data/db/migrate/20141111084845_add_termination_date_to_users.rb +5 -0
  104. data/db/migrate/20141111103759_add_requested_weekly_hours_to_users.rb +5 -0
  105. data/db/migrate/20141113094547_add_api_token_to_users.rb +5 -0
  106. data/db/migrate/20150105143729_create_templates.rb +9 -0
  107. data/db/migrate/20150105164236_add_coloumn_is_template.rb +5 -0
  108. data/db/migrate/20150106121306_add_org_id.rb +5 -0
  109. data/db/migrate/20150126070904_add_job_id_to_shifts.rb +6 -0
  110. data/db/migrate/20150203112955_add_time_zone_to_org.rb +5 -0
  111. data/db/migrate/20150204160711_add_show_owner_to_org.rb +5 -0
  112. data/db/migrate/20150210165627_add_training_hours_to_shift.rb +9 -0
  113. data/db/migrate/20150217131509_add_total_hours_to_schedules.rb +5 -0
  114. data/db/migrate/20150218094709_add_show_disable_users.rb +5 -0
  115. data/db/migrate/20150225134050_add_notes_to_cancellation.rb +9 -0
  116. data/db/migrate/20150226125524_add_unexcused_absence_note_to_cancellation.rb +9 -0
  117. data/db/migrate/20150226125811_add_cancel_shift_to_shifts.rb +9 -0
  118. data/db/migrate/20150302100542_add_picture_to_user.rb +9 -0
  119. data/db/migrate/20150304082219_add_priorty_to_user.rb +9 -0
  120. data/db/migrate/20150304094605_add_time_format_to_organization.rb +8 -0
  121. data/db/migrate/20150304142621_create_shift_offs.rb +15 -0
  122. data/db/migrate/20150306120726_add_shiftoff_to_shifts.rb +9 -0
  123. data/db/migrate/20150310103643_add_email_and_number_to_user.rb +11 -0
  124. data/db/migrate/20150311110055_add_one_sided_to_candidate.rb +9 -0
  125. data/db/migrate/20150318083934_add_notes_to_shift_trade.rb +9 -0
  126. data/db/migrate/20150408180855_add_column_status_to_unavailability.rb +8 -0
  127. data/db/migrate/20150409140324_create_assets.rb +35 -0
  128. data/db/migrate/20150409142753_create_vendors.rb +14 -0
  129. data/db/migrate/20150409144023_create_employees.rb +13 -0
  130. data/db/migrate/20150409144751_create_assign_assets.rb +16 -0
  131. data/db/migrate/20150409150449_create_asset_repair_requests.rb +19 -0
  132. data/db/migrate/20150409151023_create_dispatches.rb +13 -0
  133. data/db/migrate/20150409151329_create_vendor_ratings.rb +11 -0
  134. data/db/migrate/20150409151546_create_template_assets.rb +11 -0
  135. data/db/migrate/20150413101913_create_index_organization.rb +7 -0
  136. data/db/migrate/20150414153330_change_vendors.rb +16 -0
  137. data/db/migrate/20150420112003_add_name_to_users.rb +5 -0
  138. data/db/migrate/20150421074542_add_comment_to_ratings.rb +5 -0
  139. data/db/migrate/20150421131331_add_retire_column_to_assets.rb +5 -0
  140. data/db/migrate/20150422135600_add_attachment_avatar_to_assets.rb +11 -0
  141. data/db/migrate/20150422143242_create_importfiles.rb +8 -0
  142. data/db/migrate/20150422143301_add_attachment_avatar_to_importfiles.rb +11 -0
  143. data/db/migrate/20150423080234_change_retire_column.rb +5 -0
  144. data/db/migrate/20150423170953_add_attachment_avatar_to_vendors.rb +11 -0
  145. data/db/migrate/20150423225459_add_lockable.rb +7 -0
  146. data/db/migrate/20150427171842_create_asset_scans.rb +15 -0
  147. data/db/migrate/20150429211309_add_attachment_logo_to_organizations.rb +11 -0
  148. data/db/migrate/20150430074555_change_assets_table.rb +8 -0
  149. data/db/migrate/20150430235920_add_unique_email_index_to_users.rb +5 -0
  150. data/db/migrate/20150505104834_add_columntouser.rb +8 -0
  151. data/db/migrate/20150505140926_add_maintenance_cost_to_assets.rb +6 -0
  152. data/db/migrate/20150505142413_create_asset_images.rb +8 -0
  153. data/db/migrate/20150505152604_create_pg_search_documents.rb +17 -0
  154. data/db/migrate/20150506090012_change_employee.rb +12 -0
  155. data/db/migrate/20150506110441_add_status_to_asset_repair_requests.rb +6 -0
  156. data/db/migrate/20150507080738_change_phone_in_employees.rb +6 -0
  157. data/db/migrate/20150507101306_create_manufacturers.rb +12 -0
  158. data/db/migrate/20150507101446_remove.rb +9 -0
  159. data/db/migrate/20150507102211_add_index_manufacturer.rb +5 -0
  160. data/db/migrate/20150507104605_add_website_manufacturer.rb +5 -0
  161. data/db/migrate/20150507115535_change_refrence_manucaturer.rb +6 -0
  162. data/db/migrate/20150507150848_create_notifications.rb +9 -0
  163. data/db/migrate/20150507150855_create_notification_users.rb +10 -0
  164. data/db/migrate/20150508094912_add_landline_to_organization.rb +5 -0
  165. data/db/migrate/20150508143536_add_source_to_notifications.rb +7 -0
  166. data/db/migrate/20150508145048_add_postal_to_profile.rb +5 -0
  167. data/db/migrate/20150508162219_add_summary_to_notifications.rb +5 -0
  168. data/db/migrate/20150509220624_remove_responded_from_notifications.rb +5 -0
  169. data/db/migrate/20150509220625_add_responded_to_notifications.rb +5 -0
  170. data/db/migrate/20150509225608_change_columns_asset_repair_requests.rb +11 -0
  171. data/db/migrate/20150511105420_remove_avatar_asset.rb +6 -0
  172. data/db/migrate/20150514105700_add_unique_asset_id_to_asset.rb +5 -0
  173. data/db/migrate/20150515110042_add_deleted_at_in_assets.rb +6 -0
  174. data/db/migrate/20150515111410_add_deleted_at_vendors.rb +6 -0
  175. data/db/migrate/20150515113054_add_deleted_at_in_employee.rb +6 -0
  176. data/db/migrate/20150515142228_create_locations.rb +16 -0
  177. data/db/migrate/20150515142242_add_locations_to_assets.rb +5 -0
  178. data/db/migrate/20150515142536_add_organization_to_locations.rb +5 -0
  179. data/db/migrate/20150518123010_change_assign_asset.rb +9 -0
  180. data/db/migrate/20150518140153_add_asset_id_in_asset_assign.rb +5 -0
  181. data/db/migrate/20150518144758_rename_assign_assets.rb +8 -0
  182. data/db/migrate/20150518145248_rename_asset_assignment.rb +8 -0
  183. data/db/migrate/20150519140425_change_empid_to_string.rb +6 -0
  184. data/db/migrate/20150521085132_change_uique_asset_id_to_string.rb +6 -0
  185. data/db/migrate/20150525095045_add_status_to_organizations.rb +5 -0
  186. data/db/migrate/20150525123202_create_transactions.rb +20 -0
  187. data/db/migrate/20150526124755_create_settings.rb +16 -0
  188. data/db/migrate/20150603163451_add_cost_comment_collected_by_to_asset_repair_request.rb +7 -0
  189. data/db/migrate/20150605144111_collected.rb +5 -0
  190. data/db/migrate/20150609111725_add_column_notification.rb +5 -0
  191. data/db/migrate/20150609170014_create_user_notification_settings.rb +13 -0
  192. data/db/migrate/20150609175555_add_city_to_locations.rb +4 -0
  193. data/db/migrate/20150612190052_addcity.rb +5 -0
  194. data/db/migrate/20150614215015_create_members.rb +27 -0
  195. data/db/migrate/20150616070816_add_organization_to_schedules.rb +9 -0
  196. data/db/migrate/20150616114344_change_timestape_to_date.rb +4 -0
  197. data/db/migrate/20150619085555_add_index_repair_scan_to_repair.rb +6 -0
  198. data/db/migrate/20150623120915_create_depreciation_settings.rb +9 -0
  199. data/db/migrate/20150624060402_add_depriciation_ref_to_assets.rb +5 -0
  200. data/db/migrate/20150624085501_add_organization_ref_dep.rb +5 -0
  201. data/db/migrate/20150624114339_add_user_to_vacation_info.rb +9 -0
  202. data/db/migrate/20150624131422_change_dep_seeting.rb +6 -0
  203. data/db/migrate/20150625090838_add_dep_cost_col_in_assets.rb +5 -0
  204. data/db/migrate/20150626123545_add_vendor_id_to_asset.rb +5 -0
  205. data/db/migrate/20150629095216_add_depreciated_cost_asset.rb +5 -0
  206. data/db/migrate/20150629124325_add_allow_vendor_additon_to_setings.rb +7 -0
  207. data/db/migrate/20150630080925_add_approve_to_vendor.rb +5 -0
  208. data/db/migrate/20150630112252_add_referrenc_dereciation_to_asset.rb +5 -0
  209. data/db/migrate/20150630124838_add_ref_dep_organization.rb +5 -0
  210. data/db/migrate/20150707102850_add_column_sittings_to_delete_ticket.rb +6 -0
  211. data/db/migrate/20150710150314_add_org_ref_to_subdomain.rb +5 -0
  212. data/db/migrate/20150713204553_add_hire_dateto_member.rb +9 -0
  213. data/db/migrate/20150714004440_add_organization_to_notes.rb +9 -0
  214. data/db/migrate/20150714100444_add_time_format_to_member.rb +9 -0
  215. data/db/migrate/20150714202050_create_asset_tickets.rb +11 -0
  216. data/db/migrate/20150722151752_add_invitation_counts_to_user.rb +10 -0
  217. data/db/migrate/20150723141352_add_invitation_created_at_to_member.rb +10 -0
  218. data/db/migrate/20150724105130_create_projects.rb +8 -0
  219. data/db/migrate/20150724105257_create_project_payments.rb +13 -0
  220. data/db/migrate/20150724220844_add_user_index_to_asset.rb +6 -0
  221. data/db/migrate/20150727085046_add_projects_to_organization.rb +11 -0
  222. data/db/migrate/20150727122551_add_coloumn_to_vendors.rb +5 -0
  223. data/db/migrate/20150727211029_add_column_code_to_asset.rb +5 -0
  224. data/db/migrate/20150728101649_add_disabled_to_member.rb +9 -0
  225. data/db/migrate/20150731095354_add_column_repair_date_to_asset.rb +6 -0
  226. data/db/migrate/20150731104152_add_column_repair_reminder_setting.rb +5 -0
  227. data/db/migrate/20150806085559_create_member_devices.rb +10 -0
  228. data/db/migrate/20150807133155_add_view_to_alert.rb +9 -0
  229. data/db/migrate/20150808151840_app_col_in_member_device.rb +5 -0
  230. data/db/migrate/20150808180234_add_deleted_at_toalerts.rb +7 -0
  231. data/db/migrate/20150810110136_add_address_in_4_feilds_vendor.rb +12 -0
  232. data/db/migrate/20150810172933_change_column_type_in_vendors.rb +6 -0
  233. data/db/migrate/20150811061019_change_column_in_vendors.rb +5 -0
  234. data/db/migrate/20150811133002_change_shift_off_time.rb +5 -0
  235. data/db/migrate/20150811135657_change_column_type_timestamp_to_date.rb +7 -0
  236. data/db/migrate/20150818131207_create_history_emails.rb +10 -0
  237. data/db/migrate/20150820115042_change_schedule_total_hours.rb +6 -0
  238. data/db/migrate/20150820120309_add_column_email_remove.rb +5 -0
  239. data/db/migrate/20150820121702_add_column_email_organization.rb +5 -0
  240. data/db/migrate/20150824085019_add_column_asset_purchase_vendor.rb +5 -0
  241. data/db/migrate/20150826122944_add_column_exipry_notification.rb +5 -0
  242. data/db/migrate/20150827113937_create_members_roles.rb +9 -0
  243. data/db/migrate/20150828145913_add_locable_to_member.rb +7 -0
  244. data/db/migrate/20150903155708_add_vendor_feilds_to_user.rb +8 -0
  245. data/db/migrate/20150903200953_add_shift_to_candidate.rb +9 -0
  246. data/db/migrate/20150904082434_add_one_sided_to_trade_shift.rb +9 -0
  247. data/db/migrate/20150904134529_add_column_in_setting_user_dispatch.rb +5 -0
  248. data/db/migrate/20150907082501_add_website_for_vendor.rb +6 -0
  249. data/db/migrate/20150907141100_add_dollar_limit_to_user.rb +5 -0
  250. data/db/migrate/20150907193030_add_estimate_in_repair.rb +8 -0
  251. data/db/migrate/20150908123735_add_vendor_aproval_in_repair.rb +10 -0
  252. data/db/migrate/20150909112005_add_column_amount_into_plan.rb +5 -0
  253. data/db/migrate/20150916131512_add_plan_name_to_project_payment.rb +9 -0
  254. data/db/schema.rb +909 -0
  255. data/db/seeds.rb +23 -0
  256. data/lib/assets/.keep +0 -0
  257. data/lib/pshq_engine/version.rb +3 -0
  258. data/lib/pshq_engine.rb +5 -0
  259. data/lib/tasks/.keep +0 -0
  260. data/pshq_engine.gemspec +26 -0
  261. metadata +330 -0
@@ -0,0 +1,10 @@
1
+ class CreateCertifications < ActiveRecord::Migration
2
+ def change
3
+ create_table :certifications do |t|
4
+ t.string :name
5
+ t.integer :organization_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ class AddReminderTimeToShifts < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :reminder_time, :integer
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class CreateCertificationsUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :certifications_users do |t|
4
+ t.integer :user_id
5
+ t.integer :certification_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ class AddBirthDateToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :birth_date, :date
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddAllowRollingVHrsToOrganizations < ActiveRecord::Migration
2
+ def change
3
+ add_column :organizations, :allow_rolling_v_hrs, :boolean, :default => false
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateRecurringTimeOffs < ActiveRecord::Migration
2
+ def change
3
+ create_table :recurring_time_offs do |t|
4
+ t.integer :timeoff_id
5
+ t.string :recurring_option
6
+ t.integer :user_id
7
+ t.string :status
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ class AddTerminationDateToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :temination_date, :date
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddRequestedWeeklyHoursToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :request_weekly_hours, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddApiTokenToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :api_token , :string,:default=>"a"
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class CreateTemplates < ActiveRecord::Migration
2
+ def change
3
+ create_table :templates do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddColoumnIsTemplate < ActiveRecord::Migration
2
+ def change
3
+ add_column :schedules, :template_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddOrgId < ActiveRecord::Migration
2
+ def change
3
+ add_column :templates, :organization_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddJobIdToShifts < ActiveRecord::Migration
2
+ def change
3
+ remove_column :schedules, :job_id, :integer
4
+ add_column :shifts, :job_id, :integer
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddTimeZoneToOrg < ActiveRecord::Migration
2
+ def change
3
+ add_column :organizations, :timezone, :string, :default => 'Central Time (US & Canada)'
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddShowOwnerToOrg < ActiveRecord::Migration
2
+ def change
3
+ add_column :organizations, :show_owner, :boolean, :default => false
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class AddTrainingHoursToShift < ActiveRecord::Migration
2
+ def change
3
+ add_column :shifts, :training_hours, :Time, :default => '00:00:00'
4
+ end
5
+
6
+ def down
7
+ remove_column :shifts, :training_hours, :Time
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddTotalHoursToSchedules < ActiveRecord::Migration
2
+ def change
3
+ add_column :schedules, :total_hours, :Time, :default => "0:0"
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddShowDisableUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :organizations, :show_disabled_users, :boolean , :default => false
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class AddNotesToCancellation < ActiveRecord::Migration
2
+ def change
3
+ add_column :cancellations, :notes, :Text
4
+ end
5
+
6
+ def down
7
+ remove_column :cancellations, :notes, :Text
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddUnexcusedAbsenceNoteToCancellation < ActiveRecord::Migration
2
+ def change
3
+ add_column :cancellations, :unexcused_note, :Text
4
+ end
5
+
6
+ def down
7
+ remove_column :cancellations, :unexcused_note, :Text
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddCancelShiftToShifts < ActiveRecord::Migration
2
+ def change
3
+ add_column :shifts, :cancel_shift, :boolean, :default => false
4
+ end
5
+
6
+ def down
7
+ remove_column :shifts, :cancel_shift, :boolean, :default => false
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddPictureToUser < ActiveRecord::Migration
2
+ def self.up
3
+ add_attachment :users, :avatar
4
+ end
5
+
6
+ def self.down
7
+ remove_attachment :users, :avatar
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddPriortyToUser < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :priority, :integer, :default => 0
4
+ end
5
+
6
+ def down
7
+ remove_column :users, :priority, :integer, :default => 0
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ class AddTimeFormatToOrganization < ActiveRecord::Migration
2
+ def change
3
+ add_column :organizations, :time_format, :boolean, :default => false
4
+ end
5
+ def down
6
+ remove_column :organizations, :time_format, :boolean, :default => false
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ class CreateShiftOffs < ActiveRecord::Migration
2
+ def change
3
+ create_table :shift_offs do |t|
4
+ t.integer :organization_id
5
+ t.text :name
6
+ t.time :time
7
+ t.text :am_pm
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ def down
13
+ drop_table :shift_offs
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ class AddShiftoffToShifts < ActiveRecord::Migration
2
+ def change
3
+ add_column :shifts, :shift_off_id, :integer
4
+ end
5
+
6
+ def down
7
+ remove_column :shifts, :shift_off_id, :integer
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddEmailAndNumberToUser < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :show_email, :boolean, :default => true
4
+ add_column :users, :show_number, :boolean, :default => true
5
+ end
6
+
7
+ def down
8
+ remove_column :users, :show_email, :boolean, :default => true
9
+ remove_column :users, :show_number, :boolean, :default => true
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class AddOneSidedToCandidate < ActiveRecord::Migration
2
+ def change
3
+ add_column :candidates, :one_sided, :boolean, :default => false
4
+ end
5
+
6
+ def down
7
+ remove_column :candidates, :one_sided, :boolean, :default => false
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddNotesToShiftTrade < ActiveRecord::Migration
2
+ def change
3
+ add_column :shift_trades, :note, :text
4
+ end
5
+
6
+ def down
7
+ remove_column :shift_trades, :note, :text
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ class AddColumnStatusToUnavailability < ActiveRecord::Migration
2
+ def change
3
+ add_column :unavailables ,:status ,:string ,:default => "pending"
4
+ add_column :unavailables ,:approved_by ,:string
5
+ add_column :unavailables ,:notes ,:string
6
+ add_column :unavailables ,:approved_date ,:string
7
+ end
8
+ end
@@ -0,0 +1,35 @@
1
+ class CreateAssets < ActiveRecord::Migration
2
+ def change
3
+ create_table :assets do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.string :current_location
7
+ t.boolean :is_new
8
+ t.boolean :is_traded
9
+ t.boolean :electroic_need
10
+ t.string :volts
11
+ t.string :model_no
12
+ t.string :serial_no
13
+ t.string :sku
14
+ t.date :manufactured_date
15
+ t.date :purchased_date
16
+ t.string :purchased_from
17
+ t.text :info
18
+ t.string :replace_priority
19
+
20
+ #manufacture
21
+ t.string :company_name
22
+ t.integer :company_phone
23
+ t.text :company_detail
24
+ t.text :comapny_address
25
+ t.text :company_other
26
+ #cost
27
+ t.integer :cost_of_owner
28
+ t.integer :purchased_cost
29
+
30
+
31
+
32
+ t.timestamps
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,14 @@
1
+ class CreateVendors < ActiveRecord::Migration
2
+ def change
3
+ create_table :vendors do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+ t.integer :phone
7
+ t.string :country
8
+ t.string :city
9
+ t.text :address
10
+ t.text :comments
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ class CreateEmployees < ActiveRecord::Migration
2
+ def change
3
+ create_table :employees do |t|
4
+
5
+ t.string :first_name
6
+ t.string :last_name
7
+ t.string :designation
8
+ t.string :department
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ class CreateAssignAssets < ActiveRecord::Migration
2
+ def change
3
+ create_table :assign_assets do |t|
4
+ t.boolean :approved
5
+ t.boolean :assigned
6
+ t.date :assg_date
7
+ t.date :un_assg_date
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ add_reference :assign_assets, :requested_by, index: true
13
+ add_reference :assign_assets, :employee, index: true
14
+ add_reference :assign_assets, :approved_by, index: true
15
+ end
16
+ end
@@ -0,0 +1,19 @@
1
+ class CreateAssetRepairRequests < ActiveRecord::Migration
2
+ def change
3
+ create_table :asset_repair_requests do |t|
4
+
5
+ t.boolean :approved
6
+ t.text :comments
7
+ t.date :approved_date
8
+ t.date :requested_date
9
+
10
+
11
+ t.timestamps
12
+ end
13
+ add_reference :asset_repair_requests, :asset, index: true
14
+ add_reference :asset_repair_requests, :requested_by, index: true
15
+ add_reference :asset_repair_requests, :approved_by, index: true
16
+ add_reference :asset_repair_requests, :vendor, index: true
17
+
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ class CreateDispatches < ActiveRecord::Migration
2
+ def change
3
+ create_table :dispatches do |t|
4
+ t.date :dispatch_date
5
+ t.date :return_date
6
+ t.text :comments
7
+
8
+ t.timestamps
9
+ end
10
+
11
+ add_reference :dispatches, :asset_repair_request, index: true
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ class CreateVendorRatings < ActiveRecord::Migration
2
+ def change
3
+ create_table :vendor_ratings do |t|
4
+ t.integer :rating
5
+ t.timestamps
6
+ end
7
+
8
+ add_reference :vendor_ratings, :vendor, index: true
9
+ add_reference :vendor_ratings, :user, index: true
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class CreateTemplateAssets < ActiveRecord::Migration
2
+ def change
3
+ create_table :template_assets do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+
9
+ add_reference :template_assets, :template, index: true
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ class CreateIndexOrganization < ActiveRecord::Migration
2
+ def change
3
+ add_reference :employees, :organization, index: true
4
+ add_reference :vendors, :organization, index: true
5
+ add_reference :assets, :organization, index: true
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ class ChangeVendors < ActiveRecord::Migration
2
+ def change
3
+ drop_table :vendors
4
+ create_table :vendors do |v|
5
+ v.string :name
6
+ v.string :description
7
+ v.string :website
8
+ v.string :address
9
+ v.string :fax
10
+ v.string :email
11
+ v.string :contact_person
12
+ v.string :phone
13
+ end
14
+ add_reference :vendors, :organization, index: true
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ class AddNameToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, name, :string, :default => ""
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddCommentToRatings < ActiveRecord::Migration
2
+ def change
3
+ add_column :vendor_ratings, :comment, :string, :default => ""
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddRetireColumnToAssets < ActiveRecord::Migration
2
+ def change
3
+ add_column :assets, :retire, :boolean
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class AddAttachmentAvatarToAssets < ActiveRecord::Migration
2
+ def self.up
3
+ change_table :assets do |t|
4
+ t.attachment :avatar
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ remove_attachment :assets, :avatar
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ class CreateImportfiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :importfiles do |t|
4
+
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ class AddAttachmentAvatarToImportfiles < ActiveRecord::Migration
2
+ def self.up
3
+ change_table :importfiles do |t|
4
+ t.attachment :avatar
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ remove_attachment :importfiles, :avatar
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class ChangeRetireColumn < ActiveRecord::Migration
2
+ def change
3
+ change_column :assets, :retire, :boolean , :default => false
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class AddAttachmentAvatarToVendors < ActiveRecord::Migration
2
+ def self.up
3
+ change_table :vendors do |t|
4
+ t.attachment :avatar
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ remove_attachment :vendors, :avatar
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ class AddLockable < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :failed_attempts, :integer, default: 0
4
+ add_column :users, :unlock_token, :string
5
+ add_column :users, :locked_at, :datetime
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ class CreateAssetScans < ActiveRecord::Migration
2
+ def change
3
+ create_table :asset_scans do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.date :issue_date
7
+ t.date :expiry_date
8
+ t.date :start_date
9
+ t.attachment :scans
10
+
11
+ t.timestamps
12
+ end
13
+ add_reference :asset_scans, :asset, :unique => true
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ class AddAttachmentLogoToOrganizations < ActiveRecord::Migration
2
+ def self.up
3
+ change_table :organizations do |t|
4
+ t.attachment :logo
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ remove_attachment :organizations, :logo
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ class ChangeAssetsTable < ActiveRecord::Migration
2
+ def change
3
+ change_column :assets ,:is_new, :boolean , :default => true
4
+ change_column :assets ,:is_traded, :boolean , :default => true
5
+ change_column :assets ,:electroic_need, :boolean , :default => true
6
+
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ class AddUniqueEmailIndexToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_index :users, :email, :unique => true
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ class AddColumntouser < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :address, :text
4
+ add_column :users, :state, :string
5
+ add_column :users, :city, :string
6
+ add_column :users, :country, :string
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ class AddMaintenanceCostToAssets < ActiveRecord::Migration
2
+ def change
3
+ remove_column :assets, :cost_of_owner
4
+ add_column :assets, :maintenance_cost, :integer
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ class CreateAssetImages < ActiveRecord::Migration
2
+ def change
3
+ create_table :asset_images do |t|
4
+ t.attachment :image
5
+ end
6
+ add_reference :asset_images, :asset, :unique => true
7
+ end
8
+ end
@@ -0,0 +1,17 @@
1
+ class CreatePgSearchDocuments < ActiveRecord::Migration
2
+ def self.up
3
+ say_with_time("Creating table for pg_search multisearch") do
4
+ create_table :pg_search_documents do |t|
5
+ t.text :content
6
+ t.belongs_to :searchable, :polymorphic => true, :index => true
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ say_with_time("Dropping table for pg_search multisearch") do
14
+ drop_table :pg_search_documents
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ class ChangeEmployee < ActiveRecord::Migration
2
+ def change
3
+ remove_column :employees, :first_name
4
+ remove_column :employees, :last_name
5
+
6
+ add_column :employees, :fullName, :string
7
+ add_column :employees, :employeeId, :integer
8
+ add_column :employees, :email, :string
9
+ add_column :employees, :phone_number, :integer
10
+
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ class AddStatusToAssetRepairRequests < ActiveRecord::Migration
2
+ def change
3
+ remove_column :asset_repair_requests, :approved
4
+ add_column :asset_repair_requests, :status, :integer
5
+ end
6
+ end