collie-auth 0.2.0

A auth library for the minimal feed reader.
Documentation
use sea_query::{ColumnDef, Iden, Table, TableStatement};

#[derive(Iden)]
pub enum Keys {
    Table,
    Id,
    Access,
    Secret,
    Description,
    ExpiredAt,
}

pub fn keys_table() -> Vec<TableStatement> {
    let create = Table::create()
        .table(Keys::Table)
        .if_not_exists()
        .col(
            ColumnDef::new(Keys::Id)
                .integer()
                .not_null()
                .auto_increment()
                .primary_key(),
        )
        .col(ColumnDef::new(Keys::Access).text().not_null().unique_key())
        .col(ColumnDef::new(Keys::Secret).text().not_null())
        .col(ColumnDef::new(Keys::Description).text())
        .col(ColumnDef::new(Keys::ExpiredAt).date_time())
        .to_owned();

    vec![TableStatement::Create(create)]
}