Error Migrarting Database

0


  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

y

Dropped all tables successfully.
Migration table created successfully.
Loading stored database schema: /home/optikaas/bm/database/schema/mysql-schema.dump
Loaded stored database schema. (2,278.35ms)
Migrating: 2022_07_10_000000_create_price_groups_table

Illuminate\Database\QueryException

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'price_groups' already exists (SQL: create table price_groups (id char(36) not null, name varchar(255) not null, code varchar(255) null, details varchar(255) null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:716
712▕ // If an exception occurs when attempting to run a query, we'll format the error
713▕ // message to include the bindings with SQL, which will make this exception a
714▕ // lot more helpful to the developer instead of just the database's errors.
715▕ catch (Exception $e) {
➜ 716▕ throw new QueryException(
717▕ $query, $this->prepareBindings($bindings), $e
718▕ );
719▕ }
720▕ }

  +9 vendor frames

10 database/migrations/2022_07_10_000000_create_price_groups_table.php:38
Illuminate\Support\Facades\Facade::__callStatic()

  +33 vendor frames

44 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
[optikaas@imba bm]$ php artisan migrate:status
+------+-----------------------------------------------------------------------+-------+
| Ran? | Migration | Batch |
+------+-----------------------------------------------------------------------+-------+
| Yes | 2017_02_21_070324_create_attachments_table | 1 |
| Yes | 2017_03_17_070324_alter_attachments_table_extend_filetype | 1 |
| Yes | 2017_08_21_201100_alter_attachments_table_add_group_column | 1 |
| Yes | 2019_12_14_000001_create_personal_access_tokens_table | 1 |
| Yes | 2021_10_07_000000_update_oid_user_id_unique_index_on_orders_table | 4 |
| Yes | 2021_10_20_050000_unify_addresses_to_all_tables | 4 |
| Yes | 2021_11_22_000000_drop_delivered_by_foreign_key_from_deliveries_table | 4 |
| Yes | 2022_01_19_000000_modify_failed_jobs_table | 3 |
| Yes | 2022_02_14_025831_update_modifier_options_table | 4 |
| Yes | 2022_03_10_113257_add_event_column_to_activity_log_table | 3 |
| Yes | 2022_03_10_113258_add_batch_uuid_column_to_activity_log_table | 3 |
| Yes | 2022_03_29_162019_create_model_names_table | 2 |
| No | 2022_07_10_000000_create_price_groups_table | |
| No | 2022_07_16_000000_create_price_groups_related_table | |
+------+-----------------------------------------------------------------------+-------+

Question Resolved For: Modern Point of Sale Solution 0 Votes 13 Answers 1.4k Views
Asked by Gent 2 years ago

0

Answered by Mian Saleem

Hello,

That migrations already run. I think that is due to migrations in update that is supposed to be for basic license. I will check the release script again.

For now, you can try php artisan schema:dump --prune and then run the command again. If still same, please delete those files in database/migrations/update/ folder.

Thank you

0

Answered by Gent 2 years ago

And also i cant access /port i updated all files did the migrations

0

Answered by Gent 2 years ago

[optikaas@imba bm]$ php artisan mps:update --c --now

Have you backup the files & database? (yes/no) [no]:

y

ErrorException

Trying to access array offset on value of type null

at vendor/tecdiary/installer/src/Commands/UpdateMPS.php:68
64▕ $time = mps_config('auto_update_time', true);
65▕ $next = isset($time->checked_at) ? Carbon::parse($time->checked_at)->addDays(6)->startOfDay() : now()->subDay()->startOfDay();
66▕ if ($this->updateNow || $now->greaterThan($next)) {
67▕ $keys = json_decode(Storage::disk('local')->get('keys.json'), true);
➜ 68▕ if ($keys['mps']) {
69▕ if ($time) {
70▕ $time->checked_at = $next->toDateString();
71▕ }
72▕ Artisan::call('down');

  +15 vendor frames

16 artisan:37
Illuminate\Foundation\Console\Kernel::handle()

0

Answered by Mian Saleem 2 years ago

Hello,

I am sorry but the update command php artisan mps:update --c --now will not work till version 1 is released. We are only release manual updated at the moment. The auto update should be fine from v1 onward.

Can you please check the modules_statuses.json if the module Port is enabled. If not, you can enable it with php artisan module: enable Port

Thank you

0

Answered by Gent 2 years ago

Yes i downloaded the files uploaded to the server and replaced the ini so it uses the same db thats how i update to new and also checked for migrations but these were non to update. can u tell me did i do i right if yes i cant access /port

0

Answered by Mian Saleem 2 years ago

Hello,

Once you have uploaded the new files, you only need to run php artisan migrate command to update any database changes.

Your migration status says 2 migrations didn't run yet but you already have the tables that those migration created. My guess is that the migration file name was changed or there might be two files. If you check the check the migrations table in your database, then you can see that. If there is a record, you can update the migration column to migration filename.

I will pay more attention in future so that it won't happen again, at least not changing the previous migrations name. I am sorry for this time 😦

If there is no migration to update, then you should be good to go. If you have any issue, please let me know.

Thank you

0

Answered by Gent 2 years ago

Mian Saleem [optikaas@imba bm]$ php artisan migrate:status

Migration name ................................................................................. Batch / Status
2017_02_21_070324_create_attachments_table ............................................................ [1] Ran
2017_03_17_070324_alter_attachments_table_extend_filetype ............................................. [1] Ran
2017_08_21_201100_alter_attachments_table_add_group_column ............................................ [1] Ran
2019_12_14_000001_create_personal_access_tokens_table ................................................. [1] Ran
2021_10_07_000000_update_oid_user_id_unique_index_on_orders_table ..................................... [4] Ran
2021_10_20_050000_unify_addresses_to_all_tables ....................................................... [4] Ran
2021_11_22_000000_drop_delivered_by_foreign_key_from_deliveries_table ................................. [4] Ran
2022_01_19_000000_modify_failed_jobs_table ............................................................ [3] Ran
2022_02_14_025831_update_modifier_options_table ....................................................... [4] Ran
2022_03_10_113257_add_event_column_to_activity_log_table .............................................. [3] Ran
2022_03_10_113258_add_batch_uuid_column_to_activity_log_table ......................................... [3] Ran
2022_09_06_134723_drop_variation_foreign_keys ......................................................... [5] Ran

i ran all the migrations and update all the files but after i login to my webapp the version still remains 8.0 and the link.com/port for importing items is not working

https://pastebin.com/nuwzxWK8 this is all my migrations so far in my datatbase table

0

Answered by Mian Saleem 2 years ago

Hello,

Your migration is fine. The version is not from database or hard coded. It read from composer.json file. If you have updated the files then it should have latest version 0.9.1

Do you have any other issues?

Thank you

0

Answered by Gent 2 years ago

Mian Saleem yes i cant access /port for bulk importing aslo this is my composer https://pastebin.com/q3HzEmnt it has the latest but its not showing in my webiste

0

Answered by Mian Saleem 2 years ago

Hello,

Your composer file looks fine and has version 0.9.1

Please share the link to your installation with credentials.

Thank you

We use Cookies

We use cookies to ensure that we give you the best experience on our website. By continuing to browse the site you are agreeing to our use of cookies.