change a database type to character varying(320) for a user.email field

This commit is contained in:
2024-09-08 02:29:19 +02:00
parent a6ca71b131
commit 257d8bbade
2 changed files with 15 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2012-2022, Tomasz Sowa
* Copyright (c) 2012-2024, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -151,6 +151,7 @@ bool User::do_migration(int & current_table_version)
ok = ok && morm::Model::do_migration(current_table_version, 1, this, &User::do_migration_to_1);
ok = ok && morm::Model::do_migration(current_table_version, 2, this, &User::do_migration_to_2);
ok = ok && morm::Model::do_migration(current_table_version, 3, this, &User::do_migration_to_3);
ok = ok && morm::Model::do_migration(current_table_version, 4, this, &User::do_migration_to_4);
return ok;
}
@@ -209,6 +210,17 @@ bool User::do_migration_to_3()
}
bool User::do_migration_to_4()
{
const char * str[] = {
"ALTER TABLE core.\"user\" ALTER COLUMN email TYPE character varying(320);",
};
size_t len = sizeof(str) / sizeof(const char*);
return db_query(str, len);
}
void User::display_name(EzcEnv & env)
{
std::wstring * dname = admin_env.get_wstr(L"display_name");

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2008-2022, Tomasz Sowa
* Copyright (c) 2008-2024, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -158,6 +158,7 @@ private:
bool do_migration_to_1();
bool do_migration_to_2();
bool do_migration_to_3();
bool do_migration_to_4();
void id_is(EzcEnv & env); // takes one argument as a user id
bool is_guest();