Monthly Archives: March 2014

[oracle] changing the value of a sequence

According to oracle documentation, to change a value of a sequence, you have to drop and recreate it, using the following command: CREATE SEQUENCE table_name_seq START WITH 12345; But there are some easy ways to change the value of an existing sequence too. If you want to increment the current value by 500, you can […]

[rails 4] add a reference to a table with another name

They default way in rails 4 to add foreign keys is simply add_reference :people, :user And this will add a column user_id to the people table, if the table exists. I have been looking in the rails code where this is handled, and it is really straightforward. Note that standard rails does not really do […]

How to clean assets in rails 4

Gentle reminder, do not forget, in rails 4 rake assets:clean seems to work, but actually does nothing. That is not entirely true: it only cleans the old assets, leaving the three most recent versions of the assets intact. So it is a like a mild cleaning, a throw-away-the-garbage-clean, a bring-those-old-clothes-you-never-wear-to-the-thriftstore-clean. But sometimes that does not […]