From 1e26d4887cede8ea0fe6f6c699b1195714f2277b Mon Sep 17 00:00:00 2001 From: bioluks Date: Wed, 27 Mar 2024 01:05:10 +0300 Subject: [PATCH 1/3] Increased the max size for passwords from 60 to 254 - see #88. --- database/migrations/1503250034279_user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/1503250034279_user.ts b/database/migrations/1503250034279_user.ts index 262a472b..25ca5fcf 100644 --- a/database/migrations/1503250034279_user.ts +++ b/database/migrations/1503250034279_user.ts @@ -8,7 +8,7 @@ export default class extends BaseSchema { table.increments(); table.string('username', 80).notNullable(); table.string('email', 254).notNullable().unique(); - table.string('password', 60).notNullable(); + table.string('password', 254).notNullable(); table.json('settings'); table.timestamps(); }); From 5e8a76298b42b828151dd279b16d1ebce1098b7a Mon Sep 17 00:00:00 2001 From: Katherine Rose Date: Tue, 1 Oct 2024 15:44:46 +0000 Subject: [PATCH 2/3] Revert "Increased the max size for passwords from 60 to 254 - see #88." This reverts commit 1e26d4887cede8ea0fe6f6c699b1195714f2277b. --- database/migrations/1503250034279_user.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/1503250034279_user.ts b/database/migrations/1503250034279_user.ts index 25ca5fcf..262a472b 100644 --- a/database/migrations/1503250034279_user.ts +++ b/database/migrations/1503250034279_user.ts @@ -8,7 +8,7 @@ export default class extends BaseSchema { table.increments(); table.string('username', 80).notNullable(); table.string('email', 254).notNullable().unique(); - table.string('password', 254).notNullable(); + table.string('password', 60).notNullable(); table.json('settings'); table.timestamps(); }); From 4ba60a93f13f31fb8aa894860b1ec169d98aa033 Mon Sep 17 00:00:00 2001 From: Katherine Rose Date: Tue, 1 Oct 2024 15:46:35 +0000 Subject: [PATCH 3/3] Create migration to extend maxlen of 'password' column to 254 --- .../1727795538823_raise_password_max_len.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 database/migrations/1727795538823_raise_password_max_len.ts diff --git a/database/migrations/1727795538823_raise_password_max_len.ts b/database/migrations/1727795538823_raise_password_max_len.ts new file mode 100644 index 00000000..83202b0a --- /dev/null +++ b/database/migrations/1727795538823_raise_password_max_len.ts @@ -0,0 +1,17 @@ +import BaseSchema from '@ioc:Adonis/Lucid/Schema'; + +export default class extends BaseSchema { + protected tableName = 'users'; + + public async up() { + this.schema.alterTable(this.tableName, table => { + table.string('password', 254).notNullable().alter(); + }); + } + + public async down() { + this.schema.alterTable(this.tableName, table => { + table.string('password', 60).notNullable().alter(); + }); + } +}