Resourcemanagement/db/knex_migrations/2026-10-23-0000-add-aws-account.js
vickytechkey 8760d39ff0
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 14s
feat: add AWS SDK dependencies and database migration for aws_account table
2026-10-23 20:29:22 +05:30

23 lines
887 B
JavaScript

exports.up = async (knex) => {
const hasTable = await knex.schema.hasTable("aws_account");
if (!hasTable) {
await knex.schema.createTable("aws_account", (table) => {
table.increments("id").primary();
table.string("name", 255).notNullable();
table.string("auth_type", 64).defaultTo("keys");
table.string("access_key_id", 255).nullable();
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.dateTime("created_date").nullable();
});
}
};
exports.down = async (knex) => {
const hasTable = await knex.schema.hasTable("aws_account");
if (hasTable) {
await knex.schema.dropTable("aws_account");
}
};