From 873dd5c95fd3f9d3b6cee66f2293cf3d4de10d5b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 19:31:00 +0000 Subject: [PATCH] Restore migration changes (undo previous revert) Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com> --- .../2025-09-02-0000-add-domain-expiry.js | 4 +++- ...026-01-06-0000-fix-domain-expiry-column-type.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 db/knex_migrations/2026-01-06-0000-fix-domain-expiry-column-type.js diff --git a/db/knex_migrations/2025-09-02-0000-add-domain-expiry.js b/db/knex_migrations/2025-09-02-0000-add-domain-expiry.js index ede2e1889..b204a44d3 100644 --- a/db/knex_migrations/2025-09-02-0000-add-domain-expiry.js +++ b/db/knex_migrations/2025-09-02-0000-add-domain-expiry.js @@ -6,7 +6,9 @@ exports.up = function (knex) { .createTable("domain_expiry", (table) => { table.increments("id"); table.datetime("last_check"); - table.text("domain").unique().notNullable(); + // Use VARCHAR(255) for MySQL/MariaDB compatibility with unique constraint + // Maximum domain name length is 253 characters (255 octets on the wire) + table.string("domain", 255).unique().notNullable(); table.datetime("expiry"); table.integer("last_expiry_notification_sent").defaultTo(null); }); diff --git a/db/knex_migrations/2026-01-06-0000-fix-domain-expiry-column-type.js b/db/knex_migrations/2026-01-06-0000-fix-domain-expiry-column-type.js new file mode 100644 index 000000000..6728c5fb8 --- /dev/null +++ b/db/knex_migrations/2026-01-06-0000-fix-domain-expiry-column-type.js @@ -0,0 +1,14 @@ +// Ensure domain column is VARCHAR(255) across all database types. +// This migration ensures MySQL, SQLite, and MariaDB have consistent column type, +// even if a user installed 2.1.0-beta.0 or 2.1.0-beta.1 which had TEXT type for this column. +// Maximum domain name length is 253 characters (255 octets on the wire). +// Note: The unique constraint is already present from the original migration. +exports.up = function (knex) { + return knex.schema.alterTable("domain_expiry", function (table) { + table.string("domain", 255).notNullable().alter(); + }); +}; + +exports.down = function (knex) { + // No rollback needed - keeping VARCHAR(255) is the correct state +};