"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const drizzle_orm_1 = require("drizzle-orm");
const usersTable_1 = __importDefault(require("./usersTable"));
const types_1 = require("./types");
class AuthOtpTable extends drizzle_orm_1.AbstractTable {
    constructor() {
        super(...arguments);
        this.id = this.int('id').autoIncrement().primaryKey();
        this.phone = this.varchar('phone', { size: 256 });
        this.otp = this.varchar('otp', { size: 256 });
        this.issuedAt = this.timestamp('issued_at', { notNull: true });
        this.createdAt = this.timestamp('created_at', { notNull: true });
        this.updatedAt = this.timestamp('updated_at', { notNull: true });
        this.roleEnum = this.type(types_1.rolesEnum, 'role');
        this.userId = this.int('user_id').foreignKey(usersTable_1.default, (table) => table.id, { onDelete: 'CASCADE', onUpdate: "RESTRICT" });
        this.test = this.jsonb('test');
    }
    tableName() {
        return 'auth_otp';
    }
}
exports.default = AuthOtpTable;
//# sourceMappingURL=authOtpTable.js.map