laravelのmigrationを使用していろいろなカラムタイプを定義するとmysql上ではどういう型になるかについて。
本家はこれ。
カラム名は予約語と重なるものが多かったので、c_をカラムにつけて確認。
前半に型一覧、後半に実際の検証結果を掲載。
- 型の対応
- $table->bigIncrements(‘id’);
- $table->bigInteger(‘c_bigint’);
- $table->binary(‘c_binary’);
- $table->boolean(‘c_boolean’);
- $table->char(‘c_char’, 100);
- $table->date(‘c_date’);
- $table->dateTimeTz(‘c_datetimetz’, $precision = 0);
- $table->decimal(‘c_decimal’, $precision = 8, $scale = 2);
- $table->double(‘c_double’, 8, 2);
- $table->enum(‘c_enum’, [‘easy’, ‘normal’, ‘hard’]);
- $table->float(‘c_float’, 8, 2);
- $table->foreignId(‘c_foreignid’);
- $table->geometryCollection(‘c_geometry_collection’);
- $table->geometry(‘c_geometry’);
- $table->integer(‘c_integer’);
- $table->ipAddress(‘c_ip_address’);
- $table->json(‘c_json’);
- $table->jsonb(‘c_jsonb’);
- $table->lineString(‘c_line_string’);
- $table->longText(‘c_long_text’);
- $table->macAddress(‘c_mac_address’);
- $table->mediumInteger(‘c_medium_integer’);
- $table->mediumText(‘c_medium_text’);
- $table->morphs(‘c_morphs’);
- $table->multiLineString(‘c_multi_line_string’);
- $table->multiPoint(‘c_multi_point’);
- $table->multiPolygon(‘c_multi_polygon’);
- $table->point(‘c_point’);
- $table->polygon(‘c_polygon’);
- $table->rememberToken();
- $table->set(‘c_set’, [‘value1’, ‘value2’]);
- $table->smallInteger(‘c_small_integer’);
- $table->string(‘c_string’, 100);
- $table->text(‘c_text’);
- $table->timeTz(‘c_timetz’, $precision = 0);
- $table->time(‘c_time’, $precision = 0);
- $table->timestampTz(‘c_timestamptz’, $precision = 0);
- $table->timestamp(‘c_timestamp’, $precision = 0);
- $table->tinyInteger(‘c_tiny_integer’);
- $table->unsignedBigInteger(‘c_unsigned_big_integer’);
- $table->unsignedDecimal(‘c_unsigned_decimal’, $precision = 8, $scale = 2);
- $table->unsignedInteger(‘c_unsigned_integer’);
- $table->unsignedMediumInteger(‘c_unsigned_medium_integer’);
- $table->unsignedSmallInteger(‘c_unsigned_small_integer’);
- $table->unsignedTinyInteger(‘c_unsigned_tiny_integer’);
- $table->uuidMorphs(‘c_uuid_morphs’);
- $table->uuid(‘c_uuid’);
- $table->year(‘c_year’);
- $table->softDeletes($column = ‘deleted_at’, $precision = 0);
- $table->timestampsTz($precision = 0);
- 作業ログ
型の対応
$table->bigIncrements(‘id’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| id | bigint(20) unsigned | NO | PRI | NULL | auto_increment |
$table->bigInteger(‘c_bigint’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_bigint | bigint(20) | NO | | NULL | |
$table->binary(‘c_binary’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_binary | blob | NO | | NULL | |
$table->boolean(‘c_boolean’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_boolean | tinyint(1) | NO | | NULL | |
$table->char(‘c_char’, 100);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_char | char(100) | NO | | NULL | |
$table->date(‘c_date’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_date | date | NO | | NULL | |
$table->dateTimeTz(‘c_datetimetz’, $precision = 0);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_datetimetz | datetime | NO | | NULL | |
$table->decimal(‘c_decimal’, $precision = 8, $scale = 2);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_decimal | decimal(8,2) | NO | | NULL | |
$table->double(‘c_double’, 8, 2);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_double | double(8,2) | NO | | NULL | |
$table->enum(‘c_enum’, [‘easy’, ‘normal’, ‘hard’]);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_enum | enum('easy','normal','hard') | NO | | NULL | |
$table->float(‘c_float’, 8, 2);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_float | double(8,2) | NO | | NULL | |
$table->foreignId(‘c_foreignid’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_foreignid | bigint(20) unsigned | NO | | NULL | |
$table->geometryCollection(‘c_geometry_collection’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_geometry_collection | geometrycollection | NO | | NULL | |
$table->geometry(‘c_geometry’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_geometry | geometry | NO | | NULL | |
$table->integer(‘c_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_integer | int(11) | NO | | NULL | |
$table->ipAddress(‘c_ip_address’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_ip_address | varchar(45) | NO | | NULL | |
$table->json(‘c_json’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_json | json | NO | | NULL | |
$table->jsonb(‘c_jsonb’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_jsonb | json | NO | | NULL | |
$table->lineString(‘c_line_string’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_line_string | linestring | NO | | NULL | |
$table->longText(‘c_long_text’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_long_text | longtext | NO | | NULL | |
$table->macAddress(‘c_mac_address’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_mac_address | varchar(17) | NO | | NULL | |
$table->mediumInteger(‘c_medium_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_medium_integer | mediumint(9) | NO | | NULL | |
$table->mediumText(‘c_medium_text’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_medium_text | mediumtext | NO | | NULL | |
$table->morphs(‘c_morphs’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_morphs_type | varchar(255) | NO | MUL | NULL | |
| c_morphs_id | bigint(20) unsigned | NO | | NULL | |
$table->multiLineString(‘c_multi_line_string’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_multi_line_string | multilinestring | NO | | NULL | |
$table->multiPoint(‘c_multi_point’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_multi_point | multipoint | NO | | NULL | |
$table->multiPolygon(‘c_multi_polygon’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_multi_polygon | multipolygon | NO | | NULL | |
$table->point(‘c_point’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_point | point | NO | | NULL | |
$table->polygon(‘c_polygon’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_polygon | polygon | NO | | NULL | |
$table->rememberToken();
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| remember_token | varchar(100) | YES | | NULL | |
$table->set(‘c_set’, [‘value1’, ‘value2’]);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_set | set('value1','value2') | NO | | NULL | |
$table->smallInteger(‘c_small_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_small_integer | smallint(6) | NO | | NULL | |
$table->string(‘c_string’, 100);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_string | varchar(100) | NO | | NULL | |
$table->text(‘c_text’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_text | text | NO | | NULL | |
$table->timeTz(‘c_timetz’, $precision = 0);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_timetz | time | NO | | NULL | |
$table->time(‘c_time’, $precision = 0);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_time | time | NO | | NULL | |
$table->timestampTz(‘c_timestamptz’, $precision = 0);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_timestamptz | timestamp | NO | | NULL | |
$table->timestamp(‘c_timestamp’, $precision = 0);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_timestamp | timestamp | NO | | NULL | |
$table->tinyInteger(‘c_tiny_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_tiny_integer | tinyint(4) | NO | | NULL | |
$table->unsignedBigInteger(‘c_unsigned_big_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_unsigned_big_integer | bigint(20) unsigned | NO | | NULL | |
$table->unsignedDecimal(‘c_unsigned_decimal’, $precision = 8, $scale = 2);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_unsigned_decimal | decimal(8,2) unsigned | NO | | NULL | |
$table->unsignedInteger(‘c_unsigned_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_unsigned_integer | int(10) unsigned | NO | | NULL | |
$table->unsignedMediumInteger(‘c_unsigned_medium_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_unsigned_medium_integer | mediumint(8) unsigned | NO | | NULL | |
$table->unsignedSmallInteger(‘c_unsigned_small_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_unsigned_small_integer | smallint(5) unsigned | NO | | NULL | |
$table->unsignedTinyInteger(‘c_unsigned_tiny_integer’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_unsigned_tiny_integer | tinyint(3) unsigned | NO | | NULL | |
$table->uuidMorphs(‘c_uuid_morphs’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_uuid_morphs_type | varchar(255) | NO | MUL | NULL | |
| c_uuid_morphs_id | char(36) | NO | | NULL | |
$table->uuid(‘c_uuid’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_uuid | char(36) | NO | | NULL | |
$table->year(‘c_year’);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| c_year | year(4) | NO | | NULL | |
$table->softDeletes($column = ‘deleted_at’, $precision = 0);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| deleted_at | timestamp | YES | | NULL | |
$table->timestampsTz($precision = 0);
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| created_at | timestamp | YES | | NULL | |
| updated_at | timestamp | YES | | NULL | |
作業ログ
プロジェクトを生成後、設定ファイルをDBに接続できるように変更しておく。
$ composer create-project laravel/laravel sandbox --prefer-dist
$ cd sandbox
$ vi .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=sandbox
DB_USERNAME=sandbox
DB_PASSWORD='password'
テーブル作成用のmigrationを生成する。
$ php artisan make:migration create_sample_table
Created Migration: 2021_03_04_074713_create_sample_table
$ ls database/migrations/
2021_03_04_074713_create_sample_table.php
$ vi 2021_03_04_074713_create_sample_table.php
各型を記載したテーブルの定義は以下。
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSampleTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sample', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
//$table->id(); $table->bigIncrementsと同じ
//$table->increments('id'); unsignedInt
$table->bigIncrements('id');
$table->bigInteger('c_bigint');
$table->binary('c_binary');
$table->boolean('c_boolean');
$table->char('c_char', 100);
$table->date('c_date');
$table->dateTimeTz('c_datetimetz', $precision = 0);
$table->dateTime('c_datetime', $precision = 0);
$table->decimal('c_decimal', $precision = 8, $scale = 2);
$table->double('c_double', 8, 2);
$table->enum('c_enum', ['easy', 'normal', 'hard']);
$table->float('c_float', 8, 2);
$table->foreignId('c_foreignid');
$table->geometryCollection('c_geometry_collection');
$table->geometry('c_geometry');
$table->integer('c_integer');
$table->ipAddress('c_ip_address');
$table->json('c_json');
$table->jsonb('c_jsonb');
$table->lineString('c_line_string');
$table->longText('c_long_text');
$table->macAddress('c_mac_address');
$table->mediumInteger('c_medium_integer');
$table->mediumText('c_medium_text');
$table->morphs('c_morphs');
$table->multiLineString('c_multi_line_string');
$table->multiPoint('c_multi_point');
$table->multiPolygon('c_multi_polygon');
$table->point('c_point');
$table->polygon('c_polygon');
$table->rememberToken();
$table->set('c_set', ['value1', 'value2']);
$table->smallInteger('c_small_integer');
$table->string('c_string', 100);
$table->text('c_text');
$table->timeTz('c_timetz', $precision = 0);
$table->time('c_time', $precision = 0);
$table->timestampTz('c_timestamptz', $precision = 0);
$table->timestamp('c_timestamp', $precision = 0);
$table->tinyInteger('c_tiny_integer');
$table->unsignedBigInteger('c_unsigned_big_integer');
$table->unsignedDecimal('c_unsigned_decimal', $precision = 8, $scale = 2);
$table->unsignedInteger('c_unsigned_integer');
$table->unsignedMediumInteger('c_unsigned_medium_integer');
$table->unsignedSmallInteger('c_unsigned_small_integer');
$table->unsignedTinyInteger('c_unsigned_tiny_integer');
$table->uuidMorphs('c_uuid_morphs');
$table->uuid('c_uuid');
$table->year('c_year');
$table->softDeletes($column = 'deleted_at', $precision = 0);
$table->timestampsTz($precision = 0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sample');
}
}
マイグレーションを実行。
$ php artisan migrate
Migration table created successfully.
Migrating: 2021_03_04_074713_create_sample_table
Migrated: 2021_03_04_074713_create_sample_table (692.29ms)
作成されたテーブルの内容は以下。
mysql> desc sample;
+---------------------------+------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+------------------------------+------+-----+---------+----------------+
| id | bigint(20) unsigned | NO | PRI | NULL | auto_increment |
| c_bigint | bigint(20) | NO | | NULL | |
| c_binary | blob | NO | | NULL | |
| c_boolean | tinyint(1) | NO | | NULL | |
| c_char | char(100) | NO | | NULL | |
| c_date | date | NO | | NULL | |
| c_datetimetz | datetime | NO | | NULL | |
| c_datetime | datetime | NO | | NULL | |
| c_decimal | decimal(8,2) | NO | | NULL | |
| c_double | double(8,2) | NO | | NULL | |
| c_enum | enum('easy','normal','hard') | NO | | NULL | |
| c_float | double(8,2) | NO | | NULL | |
| c_foreignid | bigint(20) unsigned | NO | | NULL | |
| c_geometry_collection | geometrycollection | NO | | NULL | |
| c_geometry | geometry | NO | | NULL | |
| c_integer | int(11) | NO | | NULL | |
| c_ip_address | varchar(45) | NO | | NULL | |
| c_json | json | NO | | NULL | |
| c_jsonb | json | NO | | NULL | |
| c_line_string | linestring | NO | | NULL | |
| c_long_text | longtext | NO | | NULL | |
| c_mac_address | varchar(17) | NO | | NULL | |
| c_medium_integer | mediumint(9) | NO | | NULL | |
| c_medium_text | mediumtext | NO | | NULL | |
| c_morphs_type | varchar(255) | NO | MUL | NULL | |
| c_morphs_id | bigint(20) unsigned | NO | | NULL | |
| c_multi_line_string | multilinestring | NO | | NULL | |
| c_multi_point | multipoint | NO | | NULL | |
| c_multi_polygon | multipolygon | NO | | NULL | |
| c_point | point | NO | | NULL | |
| c_polygon | polygon | NO | | NULL | |
| remember_token | varchar(100) | YES | | NULL | |
| c_set | set('value1','value2') | NO | | NULL | |
| c_small_integer | smallint(6) | NO | | NULL | |
| c_string | varchar(100) | NO | | NULL | |
| c_text | text | NO | | NULL | |
| c_timetz | time | NO | | NULL | |
| c_time | time | NO | | NULL | |
| c_timestamptz | timestamp | NO | | NULL | |
| c_timestamp | timestamp | NO | | NULL | |
| c_tiny_integer | tinyint(4) | NO | | NULL | |
| c_unsigned_big_integer | bigint(20) unsigned | NO | | NULL | |
| c_unsigned_decimal | decimal(8,2) unsigned | NO | | NULL | |
| c_unsigned_integer | int(10) unsigned | NO | | NULL | |
| c_unsigned_medium_integer | mediumint(8) unsigned | NO | | NULL | |
| c_unsigned_small_integer | smallint(5) unsigned | NO | | NULL | |
| c_unsigned_tiny_integer | tinyint(3) unsigned | NO | | NULL | |
| c_uuid_morphs_type | varchar(255) | NO | MUL | NULL | |
| c_uuid_morphs_id | char(36) | NO | | NULL | |
| c_uuid | char(36) | NO | | NULL | |
| c_year | year(4) | NO | | NULL | |
| deleted_at | timestamp | YES | | NULL | |
| created_at | timestamp | YES | | NULL | |
| updated_at | timestamp | YES | | NULL | |
+---------------------------+------------------------------+------+-----+---------+----------------+
54 rows in set (0.00 sec)
型の補足
text
midiumtext
enum
最大長65,535 (216 − 1) 文字のテキスト型。
最大長 16,777,215 (224 − 1) 文字のテキスト型。
定義した値のうちの一つを保持する。
set
定義した値のうちら一つ以上(複数可)を保持する。
point
緯度・経度の組み合わせを一つ保持する。地図で表すところの点。
linestring
緯度・経度の組み合わせを複数保持する。地図で表す所の線(2点をつないだもの)。
polygon
緯度・経度の組み合わせを複数保持する。地図で表す所の領域(複数の点をつないだもの)。
コメント