You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/db/migrate/20150727105500_add_admin_em...

24 lines
492 B

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