diff --git a/winixd/models/user.cpp b/winixd/models/user.cpp index 6976327..f812ef5 100644 --- a/winixd/models/user.cpp +++ b/winixd/models/user.cpp @@ -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"); diff --git a/winixd/models/user.h b/winixd/models/user.h index d92cf45..7037d0a 100644 --- a/winixd/models/user.h +++ b/winixd/models/user.h @@ -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();