使用Sequel设置主键初始值

时间:2013-06-06 19:07:51

标签: ruby postgresql sequel

我有一个新表,我需要主键以特定值(比如1000)开始。

我正在使用Sequel和Sinatra应用程序。如何设置主键值?

1 个答案:

答案 0 :(得分:2)

我不是100%的续集部分,但在Postgres中,要么改变序列要么使用setval():

http://www.postgresql.org/docs/current/static/sql-altersequence.html

http://www.postgresql.org/docs/current/static/functions-sequence.html

据推测,您希望在迁移过程中使用其中一种。

相关问题