I pushed a Ruby on Rails test application up to Heroku and, after running the command heroku run rake db:migrate
, received a notification that says:
NOTICE: CREATE TABLE will create implicit sequence "microposts_id_seq" for serial column "microposts.id"
What is an implicit sequence? And, in this case, is a "serial column" another way to refer to a primary key?
Your table contains a column which is defined as serial
which is just a shorthand for an integer column which default value is taken from a sequence. In order to do that, PostgreSQL automatically creates a sequence that is bound to that column. The message merely tells you that such a sequence was created.
If you didn't explicitely define a serial
column, you probably defined it as "autoincremen" or whatever the Ruby term for that is.
For more details please read the manual: http://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-SERIAL
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With