Sha256: e39a95bc05c13b2c67a7fed4f91be118ab3f4fbbb2727fd1eea74f38db4cd260

Contents?: true

Size: 879 Bytes

Versions: 1

Compression:

Stored size: 879 Bytes

Contents

class CreateEmailbutlerTables < ActiveRecord::Migration<%= migration_version %>
  def self.up
    enable_extension 'pgcrypto' unless extensions.include?('pgcrypto')
    enable_extension 'uuid-ossp' unless extensions.include?('uuid-ossp')

    create_table :emailbutler_messages do |t|
      t.uuid :uuid, null: false, default: ''
      t.string :mailer, null: false
      t.string :action, null: false
      t.jsonb :params, null: false, default: {}
      t.string :send_to, array: true
      t.timestamps
    end
    add_index :emailbutler_messages, :uuid, unique: true

    create_table :emailbutler_events do |t|
      t.integer :emailbutler_message_id, null: false, index: true
      t.integer :status, null: false
      t.datetime :timestamp
      t.timestamps
    end
  end

  def self.down
    drop_table :emailbutler_messages
    drop_table :emailbutler_events
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
emailbutler-0.2.2 lib/generators/emailbutler/templates/migration.erb