20250106070444_remove_cooldown.js 721 B

123456789101112131415161718192021222324252627282930
  1. async function up(knex) {
  2. const hasCooldowns = await knex.schema.hasColumn("users", "cooldowns");
  3. if (hasCooldowns) {
  4. await knex.schema.alterTable("users", table => {
  5. table.dropColumn("cooldowns");
  6. });
  7. }
  8. const hasCooldown = await knex.schema.hasColumn("users", "cooldown");
  9. if (hasCooldown) {
  10. await knex.schema.alterTable("users", table => {
  11. table.dropColumn("cooldown");
  12. });
  13. }
  14. const hasMaliciousAttempts = await knex.schema.hasColumn("users", "malicious_attempts");
  15. if (hasMaliciousAttempts) {
  16. await knex.schema.alterTable("users", table => {
  17. table.dropColumn("malicious_attempts");
  18. });
  19. }
  20. }
  21. async function down(knex) {}
  22. module.exports = {
  23. up,
  24. down
  25. };