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/20170309095734_create_notif...

24 lines
630 B

require 'carto/db/migration_helper'
include Carto::Db::MigrationHelper
migration(
Proc.new do
create_table :notifications do
Uuid :id, primary_key: true, default: Sequel.lit('uuid_generate_v4()')
foreign_key :organization_id, :organizations, type: :uuid, on_delete: :cascade
String :icon, null: false
String :recipients
String :body, null: false
DateTime :created_at, null: false, default: Sequel::CURRENT_TIMESTAMP
end
alter_table :notifications do
add_index [:organization_id]
end
end,
Proc.new do
drop_table :notifications
end
)