From c4a727fe13acd364b65f6cc97f467d624905c6e2 Mon Sep 17 00:00:00 2001 From: diashalabi Date: Thu, 7 Oct 2021 12:22:17 +0300 Subject: [PATCH] #4601 Membership Resources Report --- ...odule.profile__create_utm_source_field.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 addons/default/visiosoft/profile-module/migrations/2021_10_07_090830_visiosoft.module.profile__create_utm_source_field.php diff --git a/addons/default/visiosoft/profile-module/migrations/2021_10_07_090830_visiosoft.module.profile__create_utm_source_field.php b/addons/default/visiosoft/profile-module/migrations/2021_10_07_090830_visiosoft.module.profile__create_utm_source_field.php new file mode 100644 index 000000000..189d32c91 --- /dev/null +++ b/addons/default/visiosoft/profile-module/migrations/2021_10_07_090830_visiosoft.module.profile__create_utm_source_field.php @@ -0,0 +1,39 @@ +fields()->findBySlugAndNamespace('utm_source', 'users')) { + $field = $this->fields() + ->create( + [ + 'slug' => 'utm_source', + 'namespace' => 'users', + 'type' => 'anomaly.field_type.text', + 'name' => 'visiosoft.module.profile::field.utm_source.name', + 'locked' => false, + ] + ); + + $stream = $this->streams()->findBySlugAndNamespace('users', 'users'); + + $this->assignments() + ->create( + [ + 'field' => $field, + 'stream' => $stream, + ] + ); + } + } + + public function down() + { + if ($field = $this->fields()->findBySlugAndNamespace('utm_source', 'users')) { + $field->delete(); + } + } +}