On Friday, April 24, 2015 at 2:32:30 PM UTC-7, Erich Hannan wrote: > > I have encountered a scenario where I'd like to force the primary keys of > two tables to the same value in our specs. I will spare you the > details/background here. > > I'd like to issue the following query from Sequel. > > ALTER TABLE tbl AUTO_INCREMENT = 1000 > > > I could obviously just use direct SQL with DB["query"], but I was > wondering if there's a native way to do this with Sequel schema > modification methods > <http://sequel.jeremyevans.net/rdoc/files/doc/schema_modification_rdoc.html>? > I > couldn't find anything obvious reading the documentation or the Sequel > source code. >
There isn't currently any specific support for this as far as I am aware. Also, I would use Database#run for this: DB.run "ALTER TABLE tbl AUTO_INCREMENT = 1000" DB["query"] should really be used if you want a select, update, insert, or delete query. On some adapters, you can use Database#[] for DDL statements, but that's not true on all adapters. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
