This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

Source code for galaxy.model.migrate.versions.0126_password_reset

Migration script for the password reset table

import logging

from sqlalchemy import Column, DateTime, ForeignKey, Integer, MetaData, String, Table

from galaxy.model.migrate.versions.util import create_table, drop_table

log = logging.getLogger(__name__)
metadata = MetaData()

PasswordResetToken_table = Table("password_reset_token", metadata,
                                 Column("token", String(32), primary_key=True, unique=True, index=True),
                                 Column("expiration_time", DateTime),
                                 Column("user_id", Integer, ForeignKey("galaxy_user.id"), index=True))

[docs]def upgrade(migrate_engine): print(__doc__) metadata.bind = migrate_engine metadata.reflect() create_table(PasswordResetToken_table)
[docs]def downgrade(migrate_engine): metadata.bind = migrate_engine metadata.reflect() drop_table(PasswordResetToken_table)