{"published":"2008-06-17 00:00:00","blog_url":"https://koseki.hatenablog.com/","image_url":null,"provider_name":"Hatena Blog","url":"https://koseki.hatenablog.com/entry/20080617/ActiveRecordSequence","author_url":"https://blog.hatena.ne.jp/koseki2/","title":" MySQL + ActiveRecord \u3067\u30b7\u30fc\u30b1\u30f3\u30b9\u756a\u53f7\u3092\u751f\u6210\u3002","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkoseki.hatenablog.com%2Fentry%2F20080617%2FActiveRecordSequence\" title=\" MySQL + ActiveRecord \u3067\u30b7\u30fc\u30b1\u30f3\u30b9\u756a\u53f7\u3092\u751f\u6210\u3002 - \u3053\u305b\u304d\u306e\u6280\u8853\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"\u3053\u305b\u304d\u306e\u6280\u8853\u65e5\u8a18","author_name":"koseki2","type":"rich","provider_url":"https://hatena.blog","height":"190","categories":["Ruby","Rails"],"description":"MySQL\u3068ActiveRecord\u3067sequence\u307f\u305f\u3044\u306a\u3053\u3068\u3092\u3059\u308b\u65b9\u6cd5\u3002LAST_INSERT_ID()\u3092\u4f7f\u3046\u3002\u3053\u3053\u3089\u3078\u3093\u3092\u53c2\u8003\u306b\u3002 http://dev.mysql.com/doc/refman/5.1/ja/information-functions.html#function_last-insert-id \u30e2\u30c7\u30eb\u3092\u751f\u6210\u3002 $ ./script/generate model xxx_sequencemigration class XxxSequences < ActiveRecord::Migration def self.up create_table :xxx_sequences\u2026","version":"1.0"}