Class: BigbluebuttonRailsTo130

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

Class Method Summary collapse

Class Method Details

.downObject



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/generators/bigbluebutton_rails/templates/migration_1_3_0.rb', line 43

def self.down
  add_column :bigbluebutton_rooms, :randomize_meetingid, :boolean, :default => true
  change_table(:bigbluebutton_rooms) do |t|
    t.remove :record
    t.remove :duration
  end
  drop_table :bigbluebutton_playback_formats
  drop_table :bigbluebutton_metadata
  remove_index :bigbluebutton_recordings, :room_id
  remove_index :bigbluebutton_recordings, :recordid
  drop_table :bigbluebutton_recordings
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
# File 'lib/generators/bigbluebutton_rails/templates/migration_1_3_0.rb', line 3

def self.up
  create_table :bigbluebutton_recordings do |t|
    t.integer :server_id
    t.integer :room_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.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

  change_table(:bigbluebutton_rooms) do |t|
    t.boolean :record, :default => false
    t.integer :duration, :default => 0
  end

  remove_column :bigbluebutton_rooms, :randomize_meetingid
end