mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 14:06:36 +00:00
Update fix-mariadb.py
This commit is contained in:
parent
07f689e5d0
commit
919ba49e28
@ -31,6 +31,7 @@ class Command(BaseCommand):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--delete-table',
|
'--delete-table',
|
||||||
action='append',
|
action='append',
|
||||||
|
default=list(),
|
||||||
metavar='TABLE',
|
metavar='TABLE',
|
||||||
type=SQLTable,
|
type=SQLTable,
|
||||||
help=_('SQL table name'),
|
help=_('SQL table name'),
|
||||||
@ -42,14 +43,20 @@ class Command(BaseCommand):
|
|||||||
_('An invalid database vendor is configured')
|
_('An invalid database vendor is configured')
|
||||||
+ f': {db.connection.vendor}'
|
+ f': {db.connection.vendor}'
|
||||||
)
|
)
|
||||||
if not db.connection.mysql_is_mariadb():
|
db_is_mariadb = (
|
||||||
|
hasattr(db.connection, 'mysql_is_mariadb') and
|
||||||
|
db.connection.mysql_is_mariadb()
|
||||||
|
)
|
||||||
|
if not db_is_mariadb:
|
||||||
raise CommandError(_('Not conbected to a MariaDB database server.'))
|
raise CommandError(_('Not conbected to a MariaDB database server.'))
|
||||||
|
|
||||||
table_names = options.get('delete_table', list())
|
table_names = options.get('delete_table')
|
||||||
|
|
||||||
|
log.info('Start')
|
||||||
if options['uuid_columns']:
|
if options['uuid_columns']:
|
||||||
self.stdout.write('Time to update the columns!')
|
self.stdout.write('Time to update the columns!')
|
||||||
|
|
||||||
|
self.stdout.write('Tables to drop:')
|
||||||
pp( table_names )
|
pp( table_names )
|
||||||
|
|
||||||
# All done
|
# All done
|
||||||
|
Loading…
Reference in New Issue
Block a user