Class: XTeamSchedule::Base

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/xteam_schedule/facilitation/base.rb

Class Method Summary collapse

Class Method Details

.build_schemaObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/xteam_schedule/facilitation/base.rb', line 5

def self.build_schema
  XTeamSchedule::Schema.define do

    create_table :schedules, :force => true do |table|
      table.column :begin_date, :date, :default => 10.years.ago.to_date
      table.column :end_date, :date, :default => 10.years.from_now.to_date
    end

    create_table :interfaces, :force => true do |table|
      table.column :schedule_id, :integer
      table.column :display_assignments_name, :boolean, :default => true
      table.column :display_resources_name, :boolean, :default => false
      table.column :display_working_hours, :boolean, :default => false
      table.column :display_resources_pictures, :boolean, :default => true
      table.column :display_total_of_working_hours, :boolean, :default => false
      table.column :display_assignments_notes, :boolean, :default => true
      table.column :display_absences, :boolean, :default => true
      table.column :time_granularity, :integer, :default => XTeamSchedule::Interface::TIME_GRANULARITIES[:month]
    end

    create_table :weekly_working_schedules, :force => true do |table|
      table.column :schedule_id, :integer
    end

    create_table :working_days, :force => true do |table|
      table.column :weekly_working_schedule_id, :integer
      table.column :name, :string
      table.column :day_begin, :string
      table.column :day_end, :string
      table.column :break_begin, :string
      table.column :break_end, :string
    end

    create_table :resource_groups, :force => true do |table|
      table.column :schedule_id, :integer
      table.column :expanded_in_library, :boolean, :default => true
      table.column :name, :string
    end

    create_table :resources, :force => true do |table|
      table.column :resource_group_id, :integer
      table.column :displayed_in_planning, :boolean, :default => true
      table.column :email, :string
      table.column :image, :string
      table.column :mobile, :string
      table.column :name, :string
      table.column :phone, :string
    end

    create_table :assignment_groups, :force => true do |table|
      table.column :schedule_id, :integer
      table.column :expanded_in_library, :boolean, :default => true
      table.column :name, :string
    end

    create_table :assignments, :force => true do |table|
      table.column :assignment_group_id, :integer
      table.column :name, :string
      table.column :colour, :string
    end

    create_table :working_times, :force => true do |table|
      table.column :resource_id, :integer
      table.column :assignment_id, :integer
      table.column :begin_date, :date
      table.column :duration, :integer
      table.column :notes, :string
    end

    create_table :holidays, :force => true do |table|
      table.column :schedule_id, :integer
      table.column :resource_id, :integer
      table.column :begin_date, :date
      table.column :end_date, :date
      table.column :name, :string
    end
  end
end