It was able to create the table in the first place, but cannot add a
column now that the table has been created. How should I debug this?
Here's more detail:
== Step 1 ==
db.py:
db.define_table('hits_log',
db.Field('hitid', 'text'),
db.Field('creation_time', 'datetime'))
.table file:
{'creation_time': 'TIMESTAMP', 'hitid': 'TEXT', 'id': 'SERIAL
PRIMARY KEY'}
postgresql schema:
id | integer | not null default
nextval('hits_log_id_seq'::regclass)
hitid | text |
creation_time | timestamp without time zone |
Indexes:
"hits_log_pkey" PRIMARY KEY, btree (id)
== Step 2 ==
Now I add a column "xmlbody":
db.define_table('hits_log',
db.Field('hitid', 'text'),
db.Field('creation_time', 'datetime'),
db.Field('xmlbody', 'text'))
I re-run web2py with:
python web2py.py -a 'foo' -i lovebox.local
I load a controller function. But it hasn't updated my postgresql
schema:
id | integer | not null default
nextval('hits_log_id_seq'::regclass)
hitid | text |
creation_time | timestamp without time zone |
Indexes:
"hits_log_pkey" PRIMARY KEY, btree (id)
even though the .table file is updated:
{'creation_time': 'TIMESTAMP',
'hitid': 'TEXT',
'id': 'SERIAL PRIMARY KEY',
'xmlbody': 'TEXT'}
and sql.log now has:
ALTER TABLE hits_log ADD xmlbody TEXT;