重命名表格? [英] Rename a table?

查看:71
本文介绍了重命名表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为 Transactions 的DynamoDB表,其中在其中记录了我应用程序中活动的审核跟踪.午夜之后,我想将表重命名为 Transactions.2015-10-01 之类,并创建一个名为 Transactions 的新表,接下来的24小时将记录到该表中我的应用程序中的活动.在此期间结束时,我会将其重命名为 Transactions.2015-10-02 等.

I have a DynamoDB table called Transactions in which I am recording an audit trail of activity in my app. After midnight I would like to rename the table to something like Transactions.2015-10-01 and create a new table called Transactions, to which I would record the next 24 hours of activity in my app. At the end of that period I would rename that to Transactions.2015-10-02 etc.

换句话说,我正在尝试实现旋转活动日志(尽管是线性的而不是圆形的).

In other words, I'm trying to implement a rotating log of activity (though linear rather than circular).

我不确定DynamoDB中是否可以重命名表.有办法吗?如果没有,还有其他方法吗?例如,如果有一个称为 Transactions 的表指针指向 Transactions.2015-10-01 ,然后在午夜,该指针将切换为 Transactions.2015-10-02 .我的应用审核逻辑只会在 Transactions 中执行插入操作,该操作会委派给正确的表.

I'm not sure there's a way to rename a table in DynamoDB. Is there a way? If not, is there another approach? For example, if there was a table pointer that was called Transactions that would point to Transactions.2015-10-01 and then at midnight that pointer would switch to to Transactions.2015-10-02. My app audit logic would simply perform insertions into Transactions which delegates to the right table.

推荐答案

Amazon DynamoDB没有命令来重命名表.唯一与表相关的命令是 CreateTable DeleteTable DescribeTable ListTables UpdateTable (不允许重命名).

Amazon DynamoDB does not have a command to rename tables. The only table-related commands are CreateTable, DeleteTable, DescribeTable, ListTables and UpdateTable (which does not permit a rename).

也没有创建表别名的功能.

Nor is there the ability to create aliases to tables.

最好的方法是让您的应用程序创建所需的表,然后将事务定向到适当的表.

The best approach would be for your application to create the desired tables and then direct transactions to the appropriate table.

这篇关于重命名表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆