Entropy/etpDatabase:
- change dumped sql table creation schema from 'CREATE TABLE' to 'CREATE TABLE IF NOT EXISTS' git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1928 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
TODO list
|
||||
- server/client-side: upload/download make.conf and package.* from portage
|
||||
- add i18n support
|
||||
- server-side: improve RDEPEND check output
|
||||
- server-side: add libtest to reagent
|
||||
|
||||
@@ -3234,6 +3234,9 @@ class etpDatabase:
|
||||
elif name.startswith("sqlite_"):
|
||||
continue
|
||||
else:
|
||||
t_cmd = "CREATE TABLE"
|
||||
if sql.startswith(t_cmd):
|
||||
sql = "CREATE TABLE IF NOT EXISTS"+sql[len(t_cmd):]
|
||||
dumpfile.write("%s;\n" % sql)
|
||||
|
||||
self.cursor.execute("PRAGMA table_info('%s')" % name)
|
||||
|
||||
@@ -5831,6 +5831,8 @@ class RepoInterface:
|
||||
if os.path.isfile(dbfile):
|
||||
os.remove(dbfile)
|
||||
dbconn = self.Entropy.openGenericDatabase(dbfile, xcache = False, indexing_override = False)
|
||||
#dbconn.initializeDatabase()
|
||||
#dbconn.createAllIndexes()
|
||||
rc = dbconn.doDatabaseImport(dumpfile, dbfile)
|
||||
dbconn.closeDB()
|
||||
del dbconn
|
||||
|
||||
Reference in New Issue
Block a user