Hi Massimo,
auth.define_tables(username=True, signature=False, migrate=False,
fake_migrate=False)
The migrate=false here was an attempt to supress the
Error:
<class 'cx_Oracle.DatabaseError'> ORA-00955: name is already used by an
existing object
Changed my connection string to sqllite and did get a wiki page that said
to create page: index. So I entered - test index creation - in the body and
got this error:
Traceback (most recent call last):
File "C:\web2py\gluon\restricted.py", line 209, in restricted
exec ccode in environment
File "C:/web2py/applications/welcome/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/welcome/controllers/default.py>, line
75, in <module>
File "C:\web2py\gluon\globals.py", line 186, in <lambda>
self._caller = lambda f: f()
File "C:/web2py/applications/welcome/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/welcome/controllers/default.py>, line
21, in index
return dict(form=auth.wiki())
File "C:\web2py\gluon\tools.py", line 3198, in wiki
return self._wiki.read(slug)['content'] if slug else self._wiki()
File "C:\web2py\gluon\tools.py", line 4647, in __call__
return self.read(zero)
File "C:\web2py\gluon\tools.py", line 4695, in read
return dict(content=XML(self.fix_hostname(page.html)))
File "C:\web2py\gluon\tools.py", line 4678, in fix_hostname
return body.replace('://HOSTNAME','://%s' % self.host)
AttributeError: 'NoneType' object has no attribute 'replace'
On Tuesday, October 9, 2012 9:30:00 PM UTC-5, Massimo Di Pierro wrote:
>
> Bill,
>
> have you tried using web2py wil sqlite only? does that work for you? I do
> not understand the reason for migrate=false.
>
> On Tuesday, 9 October 2012 17:19:28 UTC-5, Bill Thayer wrote:
>>
>> Fixing broken migrations...
>>>
>>> db.define_table(....,migrate=False,fake_migrate=True) means rebuild the
>>> table meta data according to the table definitions.
>>> db = DAL(...,fake_migrate_all=True) means you are fixing all the tables at
>>> once but will not help in narrowing down the problem.
>>>
>>> Looks like the metadata matches my table definitions. I have narrowed the
>>> problem down to wiki page does not exist in the database. Since it doesn't
>>> exist in
>>> metadata either then what's the problem? Shouldn't the behavior be to
>>> create the database table and the table metadata? That is my desire.
>>>
>>> if I delete all of my meta data that usually creates more problems. But in
>>> theory setting migrate=False, fake_migrate_all=True then all the
>>> metadata gets rebuilt without touching the database. Not my intention as I
>>> want the missing tables added.
>>>
>>>
>>> db = DAL('oracle://uname/pw@dbserver:1521', migrate=False,
>>> fake_migrate_all=True)
>>>
>>>
>>> auth.define_tables(username=True, signature=False, migrate=False,
>>> fake_migrate=True)
>>>
>>> Error:
>>>
>>> <class 'cx_Oracle.DatabaseError'> ORA-00942: table or view does not
>>> exist
>>>
>>>
>>> and Welcome /database has 6 auth tables and wiki_<media, page, tag>
>>>
>>> So this should not build metadata but go ahead and build the tables not in
>>> the database:
>>>
>>> db = DAL('oracle://uname/pw@dbserver:1521', migrate=True)
>>>
>>> auth.define_tables(username=True, signature=False, migrate=True,
>>> fake_migrate=False)
>>>
>>> Error:
>>>
>>> <class 'cx_Oracle.DatabaseError'> ORA-00955: name is already used by an
>>> existing object
>>>
>>>
>>> No Kidding! There's no way I'm going to delete my auth_user table from
>>> Oracle at this point, I have another app using it!
>>>
>>>
>>> Perhaps this will create the missing tables?
>>>
>>>
>>> db = DAL('oracle://uname/pw@dbserver:1521', migrate=True)
>>>
>>> auth.define_tables(username=True, signature=False, migrate=False,
>>> fake_migrate=False)
>>>
>>> Now my browser is spinning and spinning. I suspect that the rocket
>>> server is hung again and I need to stop the process with the task manager.
>>> I'll give it a few minutes and see.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
--