"""
This module contains a Caribou migration.

Migration Name: quotes
Migration Version: 20241216204252
"""


def upgrade(connection):
    # add your upgrade step here
    sql = """
    create table quotes
    (
        id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
        quote varchar(255) NOT NULL UNIQUE,
        author varchar(255),
        channel varchar(255),
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        last_updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    );
    """
    connection.execute(sql)
    sql = """
    create table sentences
    (
        id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
        sentence varchar(255) NOT NULL UNIQUE,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        last_updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    );
    """
    connection.execute(sql)
    connection.commit()


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