Sha256: 0412ecf932c3534cdaac90ee80e21f2b9fc56713045c5a860295b68452fa658d

Contents?: true

Size: 945 Bytes

Versions: 95

Compression:

Stored size: 945 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
  def self.up
    create_table :kafka_messages, force: true do |t|
      t.string :topic, null: false
      t.binary :message, limit: 10.megabytes
      t.binary :key
      t.string :partition_key
      t.timestamps
    end

    add_index :kafka_messages, [:topic, :id]

    create_table :kafka_topic_info, force: true do |t| # rubocop:disable Rails/CreateTableWithTimestamps
      t.string :topic, null: false
      t.string :locked_by
      t.datetime :locked_at
      t.boolean :error, null: false, default: false
      t.integer :retries, null: false, default: 0
      t.datetime :last_processed_at
    end
    add_index :kafka_topic_info, :topic, unique: true
    add_index :kafka_topic_info, [:locked_by, :error]
    add_index :kafka_topic_info, :locked_at
  end

  def self.down
    drop_table :kafka_messages
    drop_table :kafka_topic_info
  end

end

Version data entries

95 entries across 95 versions & 2 rubygems

Version Path
deimos-ruby-1.24.2 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.24.1 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.24.0 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.3 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.2 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.1.pre.beta6 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.1.pre.beta5 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.1.pre.beta4 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.1.pre.beta3 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.1.pre.beta2 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.1.pre.beta1 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.23.0 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.22.5 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.22.4 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.22.3 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.22.2 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.22.1 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.22 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.20.1 lib/generators/deimos/db_backend/templates/rails3_migration
deimos-ruby-1.20.0 lib/generators/deimos/db_backend/templates/rails3_migration