I've an existing table:
db.define_table('service_type',
    Field('cost_car_km', 'decimal(7,2)', notnull=True), ...)

there is already some data in the table. Now I changed the field to
Field('cost_car_km', 'decimal(7,3)', notnull=True),

the next time I try to call a page I get this error:
IntegrityError: FEHLER:  Spalte »cost_car_km__tmp« enthält NULL-Werte

the sql.log contains this line:
ALTER TABLE service_type ADD cost_car_km__tmp NUMERIC(7,3) NOT NULL;

I'm using PostgreSQL, Win 7 and web2py 1.99.2. Am I doing something
wrong because this happens quite often for me when I change a field
for a table containing data? To solve it I manually change the column
in the database, delete the .table file in the databases folder and
set fake_migrate=True for this table (and later remove it again).

Reply via email to