deleteDynamoTable

deleteDynamoTable is a Change Type in the Liquibase DynamoDB extension that deletes a table.

Uses

A DynamoDB table is a collection of data. It contains some number of items (rows), which may each contain any attributes (columns). For more information, see Core components of Amazon DynamoDB.

Run deleteDynamoTable

To run this Change Type, follow these steps:

  1. Add the Change Type to your changeset, as shown in the examples on this page.
  2. Specify any required attributes. Use the table on this page to see which ones your database requires.
  3. Deploy your changeset by running the update command:
  4. liquibase update

Now, Liquibase deploys your change on your DynamoDB database. By default, read operations on DynamoDB are eventually consistent. When you look at your database immediately after running liquibase update, DynamoDB may display the status of an object as CREATING, UPDATING, or DELETING. When it finishes, it displays the status as ACTIVE.

Note: If your deployment fails because the DynamoDB waiter times out or reaches a retry limit, you can modify the waiter settings using Liquibase Parameters for Amazon DynamoDB.

Available attributes

For more information, see DynamoDB API DeleteTable.

Name Type Description Requirement
tableName String

Name of the table to delete

Required

Examples

<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dynamodb="http://www.liquibase.org/xml/ns/pro-dynamodb"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog  http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
    http://www.liquibase.org/xml/ns/pro-dynamodb http://www.liquibase.org/xml/ns/pro-dynamodb/liquibase-pro-dynamodb-latest.xsd">

    <changeSet id="1" author="your.name">
        <dynamodb:deleteDynamoTable tableName="Music3XML"/>

        </rollback>
    </changeSet>

</databaseChangeLog>
databaseChangeLog:
  - changeSet:
      id: 1
      author: your.name
      changes:
        - deleteDynamoTable:
            tableName: Music3YAML
      rollback:
        empty
{
  "databaseChangeLog": [
    {
      "changeSet": {
        "id": "1",
        "author": "your.name",
        "changes": [
          {
            "deleteDynamoTable": {
              "tableName": "Music3JSON"
            }
          }
        ],
        "rollback": [
          {
            "empty": {
            }
          }
        ]
      }
    }
  ]
}

Database support

This Change Type is only supported for Amazon DynamoDB. It does not support auto rollback.