Download the PHP package nobuhiko/ec-cube2-migration without Composer
On this page you can find all versions of the php package nobuhiko/ec-cube2-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nobuhiko/ec-cube2-migration
More information about nobuhiko/ec-cube2-migration
Files in nobuhiko/ec-cube2-migration
Download nobuhiko/ec-cube2-migration
More information about nobuhiko/ec-cube2-migration
Files in nobuhiko/ec-cube2-migration
Vendor nobuhiko
Package ec-cube2-migration
Short Description Database migration tool for EC-CUBE 2
License LGPL-3.0-or-later
Package ec-cube2-migration
Short Description Database migration tool for EC-CUBE 2
License LGPL-3.0-or-later
Please rate this library. Is it a good library?
Informations about the package ec-cube2-migration
EC-CUBE 2 Migration
EC-CUBE 2系用の軽量データベースマイグレーションツール
特徴
- フル抽象化: 1つのマイグレーションファイルで MySQL, PostgreSQL, SQLite3 に対応
- 軽量: 依存は
symfony/consoleのみ - EC-CUBE 2 統合: SC_Query をそのまま使用
- CLI ツール: ec-cube2/cli と統合
インストール
使い方
ec-cube2/cli 経由でコマンドを実行します:
生成されるファイル: data/migrations/Version20260130123456_CreateLoginAttemptTable.php
マイグレーションの書き方
テーブル作成
既存テーブルの変更
生SQLの実行(DB別に異なる場合)
対応するカラム型
serial() - 主キー自動生成
serial() はテーブル名から自動的にカラム名を決定します:
命名規則: dtb_xxx → xxx_id, mtb_xxx → xxx_id
その他の型
| 抽象型 | MySQL | PostgreSQL | SQLite |
|---|---|---|---|
serial() |
INT AUTO_INCREMENT + _seq テーブル | SERIAL + SEQUENCE | INTEGER PRIMARY KEY + _seq テーブル |
integer() |
INT | INTEGER | INTEGER |
smallint() |
SMALLINT | SMALLINT | INTEGER |
bigint() |
BIGINT | BIGINT | INTEGER |
text() |
TEXT | TEXT | TEXT |
string($n) |
VARCHAR(n) | VARCHAR(n) | TEXT |
decimal($p,$s) |
DECIMAL(p,s) | NUMERIC(p,s) | REAL |
timestamp() |
DATETIME | TIMESTAMP | TEXT |
boolean() |
SMALLINT | SMALLINT | INTEGER |
blob() |
BLOB | BYTEA | BLOB |
カラム修飾子
インデックス
TEXT型カラムへのインデックス(MySQL)
MySQLではTEXT型カラムにインデックスを貼る場合、プレフィックス長が必要です。 このツールでは自動的に255が付与されます:
明示的に長さを指定することも可能です:
ライセンス
LGPL-3.0-or-later
All versions of ec-cube2-migration with dependencies
PHP Build Version
Package Version
The package nobuhiko/ec-cube2-migration contains the following files
Loading the files please wait ...