installing module failed: SQLSTATE[42000]

Laraship QuestionsCategory: issues & Bugsinstalling module failed: SQLSTATE[42000]
ClickBankGuru asked 5 years ago

Hi,

I tried to install the Payment medule, but I'm facing this issue !

===========

installing module failed: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server ver...

Attributes

Action install

Object CoralsSettingsModelsModule

Message installing module failed: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null, reference varchar(191) null, created_by int unsigned null, updat' at line 1 (SQL: create tablepayment_transactions(idint unsigned not null auto_increment primary key,owner_idint unsigned not null,owner_typevarchar(191) not null,invoice_idint unsigned null,sourcable_idint unsigned not null,sourcable_typevarchar(191) not null,amountdouble(8, 2) not null default '0',paid_currencyvarchar(191) null,paid_amountdouble(8, 2) null,typevarchar(191) null,methodvarchar(191) null,transaction_datetimestamp null,statusenum('completed', 'pending', 'cancelled') not null default 'completed',notestext null,extrajson null,referencevarchar(191) null,created_byint unsigned null,updated_byint unsigned null,deleted_attimestamp null,created_attimestamp null,updated_attimestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci). An error occurred during installation! Module has been uninstalled successfully installing module failed: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null,referencevarchar(191) null,created_byint unsigned null,updat' at line 1 (SQL: create table payment_transactions (id int unsigned not null auto_increment primary key, owner_id int unsigned not null, owner_type varchar(191) not null, invoice_id int unsigned null, sourcable_id int unsigned not null, sourcable_type varchar(191) not null, amount double(8, 2) not null default '0', paid_currency varchar(191) null, paid_amount double(8, 2) null, type varchar(191) null, method varchar(191) null, transaction_date timestamp null, status enum('completed', 'pending', 'cancelled') not null default 'completed', notes text null, extra json null, reference varchar(191) null, created_by int unsigned null, updated_by int unsigned null, deleted_at timestamp null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)

1 Answers
laraship Staff answered 5 years ago

Hello,

Under Corals/modules/Payment/Common/database/migrations/2018_04_15_000000_create_transactions_table.php line

Please change

            $table->json('extra')->nullable();

to

            $table->text('extra')->nullable();