Rails timestamps: updated_on / created_on versus created_at / updated_at -


After

I am writing a rail migration to create a table:

  create_table (table ,: Option => FEDERATED_TABLE_CONFIG% TABLE). Table | Table.timestamps table.string: country_tld end   

This results in the following table:

  table `sites` (` id` is not an integer (11) NULL AUTO_INCREMENT, `created_at` datetime default zero,` updated_at` datetime default zero, `country_tld` varchar (255) default zero, primary key (` id`)) engine = federative default charset = UTF8 connection = 'mysql: // foo Unfortunately, my foreign data source uses Old-School Rails  updated_on  and  created_on    / Code> its timings Column Tamp Of course I can get around this:  
  create_table (Table ,: option = & gt; FEDERATED_TABLE_CONFIG% Table) | Table | Table.datetime: created_on ,: table.string updated_on: country_tld end   

If any one is still using the time stamp and the behavior I want, I think about it Will be happy to know And no, I do not consider it a trivial way of doing this, its idea affects only one migration. ;)

I'm pretty sure what your question is here? Only one _at code as created_on and will be updated_on column (see Lines 84 & 88;).

As a side, you do not need a loop through an array to create a dataset in a one-liner. Use it instead:

  table.datetime: created_on ,: updated_on    

Comments