"""
This module contains a Caribou migration.

Migration Name: auth
Migration Version: 20241213175820
"""


def upgrade(connection):
    # add your upgrade step here
    sql = """
    create table users
    (
        id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
        user varchar(255) NOT NULL UNIQUE,
        access_token varchar(255) NOT NULL,
        refresh_token varchar(255) NOT NULL,
        expires_at TIMESTAMP NOT NULL,
        last_updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    );
    """
    connection.execute(sql)
    connection.commit()


def downgrade(connection):
    # add your downgrade step here
    pass
