don't fix timestamps on postgresql

This commit is contained in:
Izalia Mae 2024-09-28 06:59:09 -04:00
parent 098998084d
commit 85f062c8f3

View file

@ -214,21 +214,18 @@ def cli_run(ctx: click.Context, dev: bool = False) -> None:
@cli.command('db-maintenance') @cli.command('db-maintenance')
@click.option('--fix-timestamps', '-t', is_flag = True,
help = 'Make sure timestamps in the database are float values')
@click.pass_context @click.pass_context
def cli_db_maintenance(ctx: click.Context, fix_timestamps: bool) -> None: def cli_db_maintenance(ctx: click.Context) -> None:
'Perform maintenance tasks on the database' 'Perform maintenance tasks on the database'
if fix_timestamps:
with ctx.obj.database.session(True) as conn:
conn.fix_timestamps()
if ctx.obj.config.db_type == "postgres": if ctx.obj.config.db_type == "postgres":
return return
with ctx.obj.database.session(False) as conn: with ctx.obj.database.session(False) as s:
with conn.execute("VACUUM"): with s.transaction():
s.fix_timestamps()
with s.execute("VACUUM"):
pass pass