db-migration
db-migration copied to clipboard
The package implementing migration for yiisoft/db.
Currently show warning and fatal error: ``` Warning: require(/.../yii-db-migration.php): Failed to open stream: No such file or directory in /.../vendor/yiisoft/db-migration/bin/yii-db-migration on line 43 Call Stack: 0.0003 516288 1. {main}() /.../vendor/bin/yii-db-migration:0...
Add shortcuts for all `SchemaInterface::TYPE_*` constants. For now we have to do smthng like this in migrations to add UUID columns instead of `$b->uuidPk()->notNull()`: ```php public function __construct(private ConnectionInterface $db)...
For example, `$b->executeSqlFromFile()`. Need to come up with a good name. Variants: - `loadDump()` - `loadSql()` - `executeSqlFromFile()` - `executeSql()`
SQLite does not support `addCommentOnTable()` and `addCommentOnColumn()` but supports comments in `CREATE TABLE` query ```sql CREATE TABLE `table_name` -- table comment ( id INTEGER, -- field comment ); ``` The...
SQLite does not support `addForeignKey()` but supports foreign key constraints inside columns definitions of `CREATE TABLE` query. https://www.sqlite.org/foreignkeys.html ```sql CREATE TABLE track( trackid INTEGER, trackname TEXT, trackartist INTEGER, FOREIGN KEY(trackartist)...
NO, its not same with `Migration::addPrimaryKey()` or `Migration::addForeignKey()`. Its used directly at create table statement. ``` php $this->createTable('{{%auth}}', [ 'user_id' => $this->integer()->notNull(), 'source' => $this->string(255)->notNull(), 'source_id' => $this->string(255)->notNull(), $this->primaryKey(['user_id','source']), //...
As I said in the title, this is not a bug, but a proposal (didn't know where to write this that would be seen. Now, on my project I have...
hi all im trying this 'id' => Schema::TYPE_STRING . '(64) PRIMARY KEY', but in the new migration i cant make this 'id' => $this->string(64)->primaryKey(); is a bug or this not...
Currently we have to specify foreign key name with both adding and dropping. ``` php $this->addForeignKey( 'tests_questions_test_id_fkey', 'tests_questions', 'test_id', 'tests', 'id', 'CASCADE', 'CASCADE' ); ``` ``` php $this->dropForeignKey('tests_questions_test_id_fkey', 'tests_questions'); ```...