Skip to content

[Request] Support for DOUBLE type in Schema builder. #1955

@mikeholler

Description

@mikeholler

MySQL, SQLite, OracleDB, and PostgreSQL are all able to store 8-byte floating point numbers, however the Laravel schema builder only supports adding float columns to the database. I've spent about an hour looking for anybody bringing this issue up, but I could not find any mention of creating a column of double precision.

If this is to be implemented, I'd like to be able to create a table like so:

Schema::create('table', function($table) {
    $table->increments('id');
    $table->float('float_col');
    $table->double('double_col');
});

It really surprises me that the DOUBLE type is not supported by Laravel. We have a database that uses floating point matlab serial datetimes and in order to get the correct precision we need to use the DOUBLE type.

Edit:

If this is to big of a change and will break compatibility with other databases somehow (although I do not believe it will), it would be nice to see MySQL use the higher precision DOUBLE whenever $table->float(...) is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions