Alter the schema of your database tables by removing columns using the DataStax Astra DB REST API.
If you find an attribute is no longer required in a table, youcan remove a column by sending a DELETE request to delete the column. All column data will be deleted along with the column schema.Use the link:Delete a column endpoint to remove a column from a table you created previously.
Prerequisites
- Generate an authorization token.
- Create a table in your keyspace.
Drop the column email from the table users that was added inAdd columns to a table.
Send a DELETE request to /api/rest/v2/schemas/keyspaces/undefined/tables/undefined/columns/undefined to delete a column. All column data will be deleted along with the column schema.
Note that the URL includes the keyword columns followed by the columnname, in this case, email .Each column that you wish to drop must be executed with a separate command.
- Run the cURL call.
If the call is successful, a 204 message is returned.