mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
fix migration
This commit is contained in:
parent
5b0ad6ad9f
commit
1612ad4a4b
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||
|
||||
class VisiosoftModuleProfileCreateUtmSourceField extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (!$this->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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -28,6 +28,13 @@ class UsersFieldsSeeder extends Seeder
|
||||
'mode' => 'upload',
|
||||
]
|
||||
],
|
||||
[
|
||||
'slug' => 'utm_source',
|
||||
'namespace' => 'users',
|
||||
'type' => 'anomaly.field_type.text',
|
||||
'name' => 'visiosoft.module.profile::field.utm_source.name',
|
||||
'locked' => false,
|
||||
],
|
||||
[
|
||||
'name' => 'visiosoft.module.profile::field.country.name',
|
||||
'slug' => 'country',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user