cartodb-4.42/db/migrate/20150727105500_add_admin_email_to_organizations.rb

24 lines
492 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
Sequel.migration do
up do
begin
alter_table :organizations do
add_column :admin_email, :text
end
rescue StandardError
# Weird scenario that column already exists. probably due to a file timestamp change
end
SequelRails.connection.run(%Q{
update organizations o set admin_email = (select email from users u where o.owner_id = u.id);
})
end
down do
alter_table :organizations do
drop_column :admin_email
end
end
end