From 2d4b9b257d0e36821f0840b7768a67940b9ca751 Mon Sep 17 00:00:00 2001 From: romanetar Date: Thu, 1 Jun 2023 19:02:03 +0200 Subject: [PATCH] change default values Signed-off-by: romanetar --- app/libs/Auth/Models/User.php | 4 +- database/migrations/Version20230601162315.php | 43 +++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 database/migrations/Version20230601162315.php diff --git a/app/libs/Auth/Models/User.php b/app/libs/Auth/Models/User.php index 979e4376..db73be9f 100644 --- a/app/libs/Auth/Models/User.php +++ b/app/libs/Auth/Models/User.php @@ -437,8 +437,8 @@ public function __construct() $this->email_verified = false; $this->public_profile_show_photo = false; $this->public_profile_show_email = false; - $this->public_profile_show_fullname = false; - $this->public_profile_allow_chat_with_me = false; + $this->public_profile_show_fullname = true; + $this->public_profile_allow_chat_with_me = true; $this->password = ""; $this->identifier = null; $this->gender_specify = ""; diff --git a/database/migrations/Version20230601162315.php b/database/migrations/Version20230601162315.php new file mode 100644 index 00000000..fab494a8 --- /dev/null +++ b/database/migrations/Version20230601162315.php @@ -0,0 +1,43 @@ +addSql("ALTER TABLE users MODIFY public_profile_show_fullname tinyint(1) DEFAULT '1' NOT NULL;"); + $this->addSql("ALTER TABLE users MODIFY public_profile_allow_chat_with_me tinyint(1) DEFAULT '1' NOT NULL;"); + } + + /** + * @param Schema $schema + */ + public function down(Schema $schema): void + { + $this->addSql("ALTER TABLE users MODIFY public_profile_show_fullname tinyint(1) DEFAULT '0' NOT NULL;"); + $this->addSql("ALTER TABLE users MODIFY public_profile_allow_chat_with_me tinyint(1) DEFAULT '0' NOT NULL;"); + } +}