There’s no way to natively setup the starting offset for AUTO_INCREMENT columns in propel. Ideally, you would just set autoIncrement=”100000″ for an offset of 100000, but unfortunately they expect a boolean argument. To get around this, edit data/sql/sqldb.map and add an entry contrib.sql=propel and edit a file in data/sql/contrib.sql.
Add the following to the file:
ALTER TABLE example_table_1 AUTO_INCREMENT = 100000;
ALTER TABLE example_table_2 AUTO_INCREMENT = 100000;
Then rerun
symfony propel-insert-sql
. WARNING: this will ofcourse dump ALL of your data.Related posts:
thank you!
Great post, simple and solved a real PITA thanks,
just upgraded to propel 1.5 and this stopped working. Argghhhhh!
Anyone ideas how this might be fixed?
sorry, it wasn’t broken but it doesn’t work if I do
./symfony propel:data-load
only if I do ./symfony propel:build-all-load
As I don’t understand what goes on in these things can’t offer any insight as to how we might do this with data-load only.