Hello forum, i'm developing an extension and i want to add a column to the users table.
migrations files
add_example_column.php
<?php
use Flarum\Database\Migration;
return Migration::addColumns('users', [
'example' => ['string', 'length' => 36, 'nullable' => true]
]);
remove_example_column.php
<?php
use Flarum\Database\Migration;
return Migration::dropColumns('users', [
'example' => ['string', 'length' => 36, 'nullable' => true]
]);
After the extension is enabled on the admin panel, nothing changes in database.
I tried with php flarum migrate and says nothing to migrate
With php flarum migrate:reset --extension=vendor-name it says:
Exception: Migration file should contain an array with up/down. when opening the add_example_column.php file and so i tried to do this
add_example_column.php
<?php
use Flarum\Database\Migration;
return [
Migration::addColumns('users', [
'example' => ['string', 'length' => 36, 'nullable' => true]
]),
Migration::dropColumns('users', [
'example' => ['string', 'length' => 36, 'nullable' => true]
])
];
same error Migration file should contain-. What am i missing?