equal
deleted
inserted
replaced
354 ASK.confirm('Create db user %s ?' % user, default_is_yes=False)): |
354 ASK.confirm('Create db user %s ?' % user, default_is_yes=False)): |
355 helper.create_user(source['db-user'], source.get('db-password')) |
355 helper.create_user(source['db-user'], source.get('db-password')) |
356 print '-> user %s created.' % user |
356 print '-> user %s created.' % user |
357 if dbname in helper.list_databases(cursor): |
357 if dbname in helper.list_databases(cursor): |
358 if automatic or ASK.confirm('Database %s already exists -- do you want to drop it ?' % dbname): |
358 if automatic or ASK.confirm('Database %s already exists -- do you want to drop it ?' % dbname): |
359 cursor.execute('DROP DATABASE %s' % dbname) |
359 cursor.execute('DROP DATABASE "%s"' % dbname) |
360 else: |
360 else: |
361 print ('you may want to run "cubicweb-ctl db-init ' |
361 print ('you may want to run "cubicweb-ctl db-init ' |
362 '--drop %s" manually to continue.' % config.appid) |
362 '--drop %s" manually to continue.' % config.appid) |
363 return |
363 return |
364 createdb(helper, source, dbcnx, cursor) |
364 createdb(helper, source, dbcnx, cursor) |