Class: CreateBigbluebuttonRails

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/bigbluebutton_rails/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



116
117
118
119
120
121
122
123
124
125
126
# File 'lib/generators/bigbluebutton_rails/templates/migration.rb', line 116

def self.down
  drop_table :bigbluebutton_meetings
  drop_table :bigbluebutton_playback_formats
  drop_table :bigbluebutton_playback_types
  drop_table :bigbluebutton_metadata
  drop_table :bigbluebutton_recordings
  drop_table :bigbluebutton_rooms
  drop_table :bigbluebutton_rooms_options
  drop_table :bigbluebutton_servers
  drop_table :bigbluebutton_server_configs
end

.upObject



3
4
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/generators/bigbluebutton_rails/templates/migration.rb', line 3

def self.up
  create_table :bigbluebutton_servers do |t|
    t.string :name
    t.string :url
    t.string :secret
    t.string :version
    t.string :param
    t.timestamps
  end

  create_table :bigbluebutton_rooms do |t|
    t.integer :owner_id
    t.string :owner_type
    t.string :meetingid
    t.string :name
    t.string :attendee_key
    t.string :moderator_key
    t.string :welcome_msg
    t.string :logout_url
    t.string :voice_bridge
    t.string :dial_number
    t.integer :max_participants
    t.boolean :private, :default => false
    t.boolean :external, :default => false
    t.string :param
    t.boolean :record_meeting, :default => false
    t.integer :duration, :default => 0
    t.string :attendee_api_password
    t.string :moderator_api_password
    t.decimal :create_time, precision: 14, scale: 0
    t.string :moderator_only_message
    t.boolean :auto_start_recording, default: false
    t.boolean :allow_start_stop_recording, default: true
    t.timestamps
  end
  add_index :bigbluebutton_rooms, :meetingid, :unique => true

  create_table :bigbluebutton_room_options do |t|
    t.integer :room_id
    t.string :default_layout
    t.boolean :presenter_share_only
    t.boolean :auto_start_video
    t.boolean :auto_start_audio
    t.string :background
    t.timestamps
  end
  add_index :bigbluebutton_room_options, :room_id

  create_table :bigbluebutton_recordings do |t|
    t.integer :server_id
    t.integer :room_id
    t.integer :meeting_id
    t.string :recordid
    t.string :meetingid
    t.string :name
    t.boolean :published, :default => false
    t.datetime :start_time
    t.datetime :end_time
    t.boolean :available, :default => true
    t.string :description
    t.integer :size, limit: 8, default: 0
    t.timestamps
  end
  add_index :bigbluebutton_recordings, :room_id
  add_index :bigbluebutton_recordings, :recordid, :unique => true

  create_table :bigbluebutton_metadata do |t|
    t.integer :owner_id
    t.string :owner_type
    t.string :name
    t.text :content
    t.timestamps
  end

  create_table :bigbluebutton_playback_formats do |t|
    t.integer :recording_id
    t.integer :playback_type_id
    t.string :url
    t.integer :length
    t.timestamps
  end

  create_table :bigbluebutton_playback_types do |t|
    t.string :identifier
    t.boolean :visible, :default => false
    t.boolean :default, :default => false
    t.timestamps
  end

  create_table :bigbluebutton_meetings do |t|
    t.string :server_url
    t.string :server_secret
    t.integer :room_id
    t.string :meetingid
    t.string :name
    t.datetime :start_time
    t.decimal :create_time, precision: 14, scale: 0
    t.boolean :running, :default => false
    t.boolean :recorded, :default => false
    t.integer :creator_id
    t.string :creator_name
    t.boolean :ended, :default => false
    t.timestamps
  end
  add_index :bigbluebutton_meetings, [:meetingid, :create_time], :unique => true

  create_table :bigbluebutton_server_configs do |t|
    t.integer :server_id
    t.text :available_layouts
    t.timestamps
  end
end