I got a Laravel MySQL migration problem.
Migration:
public function up()
{
Schema::create('capsule_packages', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->tinyInteger('type')->unsigned();
$table->json('data')->nullable();
$table->decimal('price', 19, 4);
$table->text('description')->nullable();
$table->timestamps();
});
}
Error:
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,
price
decimal(19, 4) not null,description
text null,created_at' at line 1 (SQL: create table
capsule_packages(
idint unsigned not null auto_increment primary key,
namevarchar(255) not null,
typetinyint unsigned not null,
datajson null,
pricedecimal(19, 4) not null,
descriptiontext null,
created_attimestamp null,
updated_at` timestamp null) default character set utf8 collate 'utf8_unicode_ci')