Restore migration changes (undo previous revert)

Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-06 19:31:00 +00:00
parent b49c5aa463
commit 873dd5c95f
2 changed files with 17 additions and 1 deletions

View File

@ -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);
});

View File

@ -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
};