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



95
96
97
98
99
100
101
102
103
# File 'lib/generators/bigbluebutton_rails/templates/migration.rb', line 95

def self.down
  drop_table :bigbluebutton_meetings
  drop_table :bigbluebutton_playback_formats
  drop_table :bigbluebutton_metadata
  drop_table :bigbluebutton_recordings
  drop_table :bigbluebutton_rooms
  drop_table :bigbluebutton_rooms_options
  drop_table :bigbluebutton_servers
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
# 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 :salt
    t.string :version
    t.string :param
    t.timestamps
  end

  create_table :bigbluebutton_rooms do |t|
    t.integer :server_id
    t.integer :owner_id
    t.string :owner_type
    t.string :meetingid
    t.string :name
    t.string :attendee_password
    t.string :moderator_password
    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, :default => false
    t.integer :duration, :default => 0
    t.timestamps
  end
  add_index :bigbluebutton_rooms, :server_id
  add_index :bigbluebutton_rooms, :meetingid, :unique => true
  add_index :bigbluebutton_rooms, :voice_bridge, :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.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.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.string :format_type
    t.string :url
    t.integer :length
    t.timestamps
  end

  create_table :bigbluebutton_meetings do |t|
    t.integer :server_id
    t.integer :room_id
    t.string :meetingid
    t.string :name
    t.datetime :start_time
    t.boolean :running, :default => false
    t.boolean :record, :default => false
    t.integer :creator_id
    t.string :creator_name
    t.timestamps
  end
  add_index :bigbluebutton_meetings, [:meetingid, :start_time], :unique => true
end