fix(aws): alter aws_account.user_id to varchar(255) for better-auth compatibility
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 44s

This commit is contained in:
vickytechkey 2026-10-23 21:09:52 +05:30
parent 12253e685f
commit ec8ab87996
2 changed files with 28 additions and 1 deletions

View file

@ -9,7 +9,7 @@ exports.up = async (knex) => {
table.text("secret_access_key").nullable();
table.text("session_token").nullable();
table.string("region", 64).defaultTo("us-east-1");
table.integer("user_id").unsigned().nullable();
table.string("user_id", 255).nullable();
table.dateTime("created_date").nullable();
});
}

View file

@ -0,0 +1,27 @@
exports.up = async (knex) => {
const hasTable = await knex.schema.hasTable("aws_account");
if (hasTable) {
const isPostgres = knex.client.dialect === "postgresql" || knex.client.config.client === "pg";
if (isPostgres) {
await knex.raw('ALTER TABLE "aws_account" ALTER COLUMN "user_id" TYPE VARCHAR(255);');
} else {
try {
await knex.schema.alterTable("aws_account", (table) => {
table.string("user_id", 255).nullable().alter();
});
} catch (error) {
console.error("Error altering user_id column:", error.message);
}
}
}
};
exports.down = async (knex) => {
const hasTable = await knex.schema.hasTable("aws_account");
if (hasTable) {
const isPostgres = knex.client.dialect === "postgresql" || knex.client.config.client === "pg";
if (isPostgres) {
await knex.raw('ALTER TABLE "aws_account" ALTER COLUMN "user_id" TYPE INTEGER;');
}
}
};