"""Remember when a collection was last opened. A list of libraries sorted by when they were made is a list in the order you happened to create things, which is not the order anyone looks for them in. "Last used" is, and it is the default sort on the collections page. Null on every existing row: we did not record it before, and backfilling from `created_at` would invent a use that never happened. Revision ID: f2a3b4c5d6e7 Revises: e1f2a3b4c5d6 """ import sqlalchemy as sa from alembic import op revision = "f2a3b4c5d6e7" down_revision = "e1f2a3b4c5d6" branch_labels = None depends_on = None def upgrade() -> None: op.add_column("user_collections", sa.Column("last_used_at", sa.DateTime(), nullable=True)) def downgrade() -> None: op.drop_column("user_collections", "last_used_at")