Comments (11)
okay i have verified the version is 4.3.1 even if in the file migrationController it is still 4.3.0
from yii2-migration.
version 4.3.1 of this extension has already been released but i cannot get it through composer
How do you have it set in the composer.json?
And as for the rest:
Please provide me with the SQL statement to create the table you made the migration of.
from yii2-migration.
CREATE TABLE announcement
(
annID
int(11) NOT NULL AUTO_INCREMENT,
instructorID
int(11) DEFAULT NULL,
course_code
varchar(7) DEFAULT NULL,
content
varchar(500) NOT NULL,
ann_date
date NOT NULL DEFAULT current_timestamp(),
ann_time
time NOT NULL DEFAULT current_timestamp(),
from yii2-migration.
that is how it was created...you can see how different it is from the output of the migration command
from yii2-migration.
This is happening because of this line in Yii 2 core. The expression current_timestamp()
or current_timestamp
is recognized only for columns of type datetime
or timestamp
while you are providing date
and time
here. But since it works obviously (on MariaDB at least, MySQL is not allowing functions as defaults) I need to see if the update in the Yii 2 needs to be done.
from yii2-migration.
If the update happens I will link it here but since this depends on the Yii core I cannot fix it and it won't work for previous versions of Yii anyway.
from yii2-migration.
This is happening because of this line in Yii 2 core. The expression
current_timestamp()
orcurrent_timestamp
is recognized only for columns of typedatetime
ortimestamp
while you are providingdate
andtime
here. But since it works obviously (on MariaDB at least, MySQL is not allowing functions as defaults) I need to see if the update in the Yii 2 needs to be done.
but YII2 have added another function which i thought would work properly in this case, defaultExpression(). since expressions like current_timestamp or current_timestamp() work well in a database for date columns, i think it should be handled well to work with migrations for the same column types.
from yii2-migration.
The method you are talking about is used to create an sql statement but here I'm extracting this data from the table and Yii is not aware that it is an expression because of what I showed you so it says it must be a simple text.
from yii2-migration.
Okay that's a YII2 fix then
from yii2-migration.
My fix is already merged, waiting for the release.
from yii2-migration.
Yii 2.0.47 has been released.
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
- Unclear of the cause of migration/update causing: [23000]: Integrity constraint violation HOT 7
- 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] 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.