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.
24 lines
478 B
24 lines
478 B
Sequel.migration do
|
|
|
|
up do
|
|
begin
|
|
alter_table :organizations do
|
|
add_column :admin_email, :text
|
|
end
|
|
rescue
|
|
# 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
|