Removing timestamp fields from a schema

I used the default generator to create some tables, and they all had this t.timestampin their definition, so the created schema also created the created_at and updated_at fields. Now they told me that I do not need these two fields in my scheme, so I went to the source files create_table * and pulled out the line t.timestamp from them and ran the commands db:migrateand schema:load But still, when I go to my schema.rb file, I see that they are still there.

Is there something wrong I'm doing here?

+5
source share
1 answer

Run

rails g migration remove_timestamps_from_table created_at updated_at

table . , x y, , .

rake db:migrate

rake db:test:prepare

, !

. , .

+13

All Articles