search for: auto_inc

Displaying 4 results from an estimated 4 matches for "auto_inc".

2006 Mar 29
2
delete_all not resetting auto incement in database
...art off at 840 (responding to the number of skills times the number of times I reloaded data). From my log I can see that the SQL query that''s performed is DELETE FROM... and not TRUNCATE (which resets the auto increment counter) It seems that Skill.delete_all doesn''t reset the auto_increment counter on the database table. Hope you can help me with my questions here: Q1: Is it a bug in Rails that Class.delete_all does not reset auto_incement counter? Q2: Is there a workaround that I can use? (for instance, how can I do an SQL query ''TRUNCATE skills'')...
2007 Jan 18
8
How can I find out which attribute is screwing up pluralize/singularize?
Hey there :) I''m creating this app on top of a legacy database, that has a mixture of auto_inc ids, non-''id'' named pks, non-integer-pks, foreign keys that end in _code instead of _id, etc. I have the model working great in the console, where I can create any modeled object and reference other objects without issues. However, I''m running into problems with plugins...
2006 Jul 18
3
DB Migrations & Column Order
Hello, I created a table and about 10 migrations down the line I decided that I needed to add an ID column (this was actually a table for a has_many :through and I recently realized that it needs an ID column, unlike HABTM tables). I am a big perfectionist and I frequently run "SHOW COLUMNS IN table;", so I naturally expect to see the "id" column the first one listed. However,
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
...Listing.new(params[:listing]) @listing.categories = Category.find(params[:category_ids] # this works @listing.subcategories = Subcategory.find(params[:subcategory_ids] # doesn''t if @listing.save ... ... end And the databases: create table listings ( id int not null auto_increment, <various text fields> primary key (id) ); create table subcategories ( id int not null auto_increment name varchar(100) not null, category_id int not null, constraint fk_items_category foreign key (category_id) references categories(id), primary key (id) ); crea...