We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have described table as below:
Schema::create('movies', function (Blueprint $table) { $table->increments('id'); $table->string('title'); $table->string('title_en')->nullable(); $table->integer('year')->default(0); $table->integer('duration')->default(0); $table->text('description')->nullable(); $table->float('rating_imdb', 2, 1)->nullable(); $table->float('rating_kinopoisk',2, 1)->nullable(); $table->integer('megogo_id')->unsigned()->unique()->nullable(); $table->integer('kinopoisk_id')->unsigned()->nullable(); $table->unique(['megogo_id', 'kinopoisk_id']); });
Pay attention for two columns of type float: $table->float('rating_imdb', 2, 1)->nullable(); $table->float('rating_kinopoisk',2, 1)->nullable();
But in database laravel creates columns with type of double
CREATE TABLE `movies` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(191) NOT NULL COLLATE 'utf8mb4_unicode_ci', `title_en` VARCHAR(191) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci', `year` INT(11) NOT NULL DEFAULT '0', `duration` INT(11) NOT NULL DEFAULT '0', `description` TEXT NULL COLLATE 'utf8mb4_unicode_ci', `rating_imdb` DOUBLE(2,1) NULL DEFAULT NULL, `rating_kinopoisk` DOUBLE(2,1) NULL DEFAULT NULL, `megogo_id` INT(10) UNSIGNED NULL DEFAULT NULL, `kinopoisk_id` INT(10) UNSIGNED NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `movies_megogo_id_kinopoisk_id_unique` (`megogo_id`, `kinopoisk_id`), UNIQUE INDEX `movies_megogo_id_unique` (`megogo_id`) ) COLLATE='utf8mb4_unicode_ci' ENGINE=InnoDB ;
php artisan migrate
The text was updated successfully, but these errors were encountered:
@strobil Laravel treats float as double in the blueprint.
float
double
Sorry, something went wrong.
#9103
@ccrims0n But if i want double, i will use $table->double, isn't it?
$table->double
check #9103
No branches or pull requests
Description:
I have described table as below:
Pay attention for two columns of type float:
$table->float('rating_imdb', 2, 1)->nullable();
$table->float('rating_kinopoisk',2, 1)->nullable();
But in database laravel creates columns with type of double
Steps To Reproduce:
php artisan migrate
The text was updated successfully, but these errors were encountered: