truncate with foreign-key depends on DB.
for postgresql :
def clear_tbls():
str1 = ','.join( [ t for t in db.tables() if "auth_" not in t] )
if len(str1):
db.executesql( 'truncate {} RESTART IDENTITY'.format(str1) )
понедельник, 14 ноября 2011 г., 3:38:15 UTC+3 пользоват
I wan't to clean up my database trough an script with i want to use as a
data generator for demo purposes it work's fine wth SQLite but with Mysql
got a lot of error's:
def limpiar_db(db, models):
for m in models:
l("Limpiando tabla: {}".format(m))
db[m].truncate()
db.com
In the case of sqlite it is easy enough to also delete the content of the
databases/ folder.
On Sunday, 16 April 2017 09:37:11 UTC-5, Matthew J Watts wrote:
>
> I had to log out of my webapp before deleting the database data, otherwise
> i would get an error message
>
> cheers
>
> On Monday, Nov
I had to log out of my webapp before deleting the database data, otherwise
i would get an error message
cheers
On Monday, November 14, 2011 at 1:38:15 AM UTC+1, Archibald Linx wrote:
>
> Dear Web2py users,
>
> How can I reset the database of my Web2py project ?
>
> Thanks,
> Archibald
--
Re
Thanks to everybody.
Archibald
On 14 nov, 21:33, Vinicius Assef wrote:
> SQLite? Just delete yourdatabasefile.
>
> Web2py will recreate it next time you execute your app.
>
> If it doesn't help, try something like that in web2py
> shell:http://pastebin.com/w0q4yKkK
>
> --
> Vinicius Assef.
>
>
SQLite? Just delete your database file.
Web2py will recreate it next time you execute your app.
If it doesn't help, try something like that in web2py shell:
http://pastebin.com/w0q4yKkK
--
Vinicius Assef.
On Mon, Nov 14, 2011 at 10:56 AM, Archibald Linx
wrote:
> Thank you Bruno.
>
> I am usi
using sqlite. just go to /databases folder and delete everything there.
web2py will create it all again.
http://zerp.ly/rochacbruno
Em 14/11/2011 10:56, "Archibald Linx" escreveu:
> Thank you Bruno.
>
> I am using SQLite.
>
> I want to reset all the tables of my project.
>
> Thanks,
> Archibald
Web2py tries to redefine tables in line with changes in the model file
but sometimes this is not possible with sqlite. Therefore you may want
to delete the table definitions as well. If you do want a clean sheet
of paper then do this:
exclude=[]
import os
import glob
import sys
sys.path.append("c:
On Mon, 2011-11-14 at 06:02 -0800, DenesL wrote:
> Hi Archibald,
>
> if you want to clear all records from a table do:
>
> db.table.truncate()
>
> To clear all just loop thru db.tables .
>
> db.commit() to finish.
>
> It should work for all DBs.
>
>
> On Nov 14, 7:56 am, Archibald Linx w
Hi Archibald,
if you want to clear all records from a table do:
db.table.truncate()
To clear all just loop thru db.tables .
db.commit() to finish.
It should work for all DBs.
On Nov 14, 7:56 am, Archibald Linx wrote:
> Thank you Bruno.
>
> I am using SQLite.
>
> I want to reset all the ta
Thank you Bruno.
I am using SQLite.
I want to reset all the tables of my project.
Thanks,
Archibald
On 14 nov, 01:44, Bruno Rocha wrote:
> which database engine?
>
> http://zerp.ly/rochacbruno
> Em 13/11/2011 22:38, "Archibald Linx" escreveu:
>
>
>
>
>
>
>
> > Dear Web2py users,
>
> > How can
11 matches
Mail list logo