Comments (7)
I'm guessing that one of your existing migrations contains the instruction to insert data into the database, and you are not using the insert
or execute
action to do that - is it the case?
If so, the only thing I can suggest is to put that migration on the skipMigrations
list so it can be skipped on the extraction step. Or you can update the instruction to use insert
or execute
- my package will ignore it then.
If this is not the case let me know, you might stumble upon some error that I need to fix.
from yii2-migration.
Yes, please. I'm closing this one.
from yii2-migration.
Closing since there is no response. Please comment here if you want to continue with that issue.
from yii2-migration.
Hi there, sorry for delay. You are correct, I am not using insert or execute in the migration generating the error. I went through and excluded all of my data init migrations using --skip-migrations
and it began working.
from yii2-migration.
Okay, I now have a new problem and haven't quite figured it out. So I've noticed that most of my tables generator this error:
> Comparing current table 'rtm_auth_assignment' with its migrations ...DONE!
> Comparing current table 'rtm_auth_item' with its migrations ...TABLE IS UP-TO-DATE.
> Comparing current table 'rtm_auth_item_child' with its migrations ...DONE!
> Comparing current table 'rtm_auth_rule' with its migrations ...TABLE IS UP-TO-DATE.
> Comparing current table 'rtm_category' with its migrations ...ERROR!
> Column data must be provided as an instance of yii\db\ColumnSchemaBuilder. Do you have column configuration provided as a string while not using experimental mode (--ex)?
I'm unclear of what I am doing wrong in my original migration? I am simply extending yii\db\Migration. I am relatively new to yii (I'm using yii2), so it's possible I simply did something the non-yii way? Here is the migration:
<?php
use yii\db\Migration;
class m210814_125114_012_create_table_rtm_category extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=InnoDB';
}
$this->createTable(
'{{%category}}',
[
'id' => $this->primaryKey(),
'uuid' => $this->string(36),
'oplock' => $this->integer()->defaultValue('0')->notNull(),
'user_id' => $this->integer()->notNull(),
'created_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),
'updated_at' => $this->dateTime(),
'deleted_at' => $this->dateTime(),
'deleted_by' => $this->integer()->defaultValue('0'),
'created_by' => $this->integer(),
'updated_by' => $this->integer(),
'name' => $this->string()->notNull(),
'global_id' => $this->integer()->notNull()->defaultValue('0'),
'global_enabled' => $this->boolean()->notNull()->defaultValue('0'),
'is_active' => $this->boolean()->notNull()->defaultValue('1'),
],
$tableOptions
);
$this->createIndex('user_id', '{{%category}}', ['user_id']);
$this->addForeignKey(
'rtm_category_ibfk_1',
'{{%category}}',
['user_id'],
'{{%user}}',
['id'],
'RESTRICT',
'NO ACTION'
);
}
public function down()
{
$this->dropTable('{{%category}}');
}
}
from yii2-migration.
Next time please create a new issue for a new problem. I've run this migration locally and I cannot see any problem. Please provide all relevant migrations and the exact command you are using to run them.
from yii2-migration.
Okay, I thought about creating a new issue but sometimes people want a thread to play out. It's a 50/50 thing. I can create a new issue now and start from there to keep this thread clean?
from yii2-migration.
Related Issues (20)
- Dependabot can't resolve your PHP dependency files
- [Bug] update after renameTable() HOT 1
- [Bug] Missing compatibility with MySQL 8
- [Bug] update of a migration does not work without Yii autoloader HOT 4
- [Bug] > SQLSTATE[08004] [1040] Too many connections HOT 1
- [Bug] Asterisk not working with migration/create HOT 5
- [Bug] Column data must be provided as an instance of yii\db\ColumnSchemaBuilder. HOT 10
- get all data from table HOT 1
- [Bug] Primary key not included as index in StructureBuilder::addHiddenIndexes() for MySQL dbs
- [Feature] Different timestamp for migration file names as Yii operates on time and breaks the migration processes HOT 3
- [Bug] Problem with parsing ENUMS in migrations
- [Q] Unable to get Migration Working Correctly HOT 2
- Migration/Update drops column instead of using renameColumn command HOT 1
- migration/update produces: Column data must be provided as an instance of yii\db\ColumnSchemaBuilder HOT 1
- [Bug] Primary Key Int Length setting to 10 instead of 11 HOT 3
- [Bug] Dropping table with foreign key on update
- [Bug] Setting default values using expressions fails HOT 11
- [Bug] Invalid path alias: @bizley/migration/views/migration.php HOT 4
- [Bug] Multiple definitions exist for class 'Migration' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-migration.