Class: CreateSchemaMigrations

Inherits:
Dynomite::Migration show all
Includes:
Dynomite::Client
Defined in:
lib/dynomite/migration/internal/migrate/create_schema_migrations.rb

Instance Method Summary collapse

Methods inherited from Dynomite::Migration

#add_gsi, #create_table, #delete_table, #remove_gsi, #update_gsi, #update_table, #update_time_to_live

Methods included from Dynomite::Migration::Helpers

#table_name_with_namespace

Methods included from Dynomite::Item::WaiterMethods

#waiter

Instance Method Details

#table_exist?(full_table_name) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
# File 'lib/dynomite/migration/internal/migrate/create_schema_migrations.rb', line 11

def table_exist?(full_table_name)
  client.describe_table(table_name: full_table_name)
  true
rescue Aws::DynamoDB::Errors::ResourceNotFoundException
  false
end

#upObject



4
5
6
7
8
9
# File 'lib/dynomite/migration/internal/migrate/create_schema_migrations.rb', line 4

def up
  create_table :schema_migrations do |t|
    t.partition_key "version:number" # required
    t.billing_mode "PAY_PER_REQUEST"
  end
end