blob: accf3eef4738ab624b389733024c17eed7328628 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
class ChangeScheduleInvertal < ActiveRecord::Migration
def up
if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
connection.execute(%q{
ALTER TABLE projects
ALTER COLUMN polling_interval
TYPE integer USING CAST(polling_interval AS integer)
})
else
change_column :projects, :polling_interval, :integer, null: true
end
end
def down
if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
connection.execute(%q{
ALTER TABLE projects
ALTER COLUMN polling_interval
TYPE integer USING CAST(polling_interval AS varchar)
})
else
change_column :projects, :polling_interval, :string, null: true
end
end
end
|