Merge branch 'master' of git://git.assembla.com/mctfpdb.git

This commit is contained in:
eblade
2009-03-23 20:59:53 -04:00
3 changed files with 16 additions and 18 deletions
+11 -10
View File
@@ -52,7 +52,7 @@ indexes = [
, [ # indexes for postgres (list index 3)
{'tab':'Boardcards', 'col':'handId', 'drop':0}
, {'tab':'Gametypes', 'col':'siteId', 'drop':0}
, {'tab':'Hands', 'col':'gametypeId', 'drop':1}
, {'tab':'Hands', 'col':'gametypeId', 'drop':0} # mct 22/3/09
, {'tab':'Hands', 'col':'siteHandNo', 'drop':0}
, {'tab':'HandsActions', 'col':'handplayerId', 'drop':0}
, {'tab':'HandsPlayers', 'col':'handId', 'drop':1}
@@ -161,12 +161,13 @@ def prepareBulkImport(fdb):
pass
elif fdb.backend == PGSQL:
# DON'T FORGET TO RECREATE THEM!!
print "dropping pg fk", fk['fktab'], fk['fkcol']
#print "dropping pg fk", fk['fktab'], fk['fkcol']
try:
fdb.cursor.execute("alter table " + fk['fktab'] + " drop constraint "
+ fk['fktab'] + '_' + fk['fkcol'] + '_fkey')
#print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol'])
fdb.cursor.execute("alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']))
print "dropped pg fk pg fk %s_%s_fkey" % (fk['fktab'], fk['fkcol'])
except:
pass
print "! failed drop pg fk %s_%s_fkey" % (fk['fktab'], fk['fkcol'])
else:
print "Only MySQL and Postgres supported so far"
return -1
@@ -181,15 +182,15 @@ def prepareBulkImport(fdb):
pass
elif fdb.backend == PGSQL:
# DON'T FORGET TO RECREATE THEM!!
print "Index dropping disabled for postgresql."
print "dropping pg index ", idx['tab'], idx['col']
#print "Index dropping disabled for postgresql."
#print "dropping pg index ", idx['tab'], idx['col']
# mod to use tab_col for index name?
try:
print "drop index %s_%s_idx" % (idx['tab'],idx['col'])
fdb.cursor.execute( "drop index %s_%s_idx" % (idx['tab'],idx['col']) )
print "dropped pg index ", idx['tab'], idx['col']
print "drop index %s_%s_idx" % (idx['tab'],idx['col'])
#print "dropped pg index ", idx['tab'], idx['col']
except:
pass
print "! failed drop index %s_%s_idx" % (idx['tab'],idx['col'])
else:
print "Only MySQL and Postgres supported so far"
return -1