Comments (4)
Apologies for not getting back to you.
Can you provide an example and I will look into it.
from yii2-migration-utility.
This is the example,
create table test(
columna varchar(20) not null,
columnb varchar(20) not null,
columnc varchar(20) not null,
primary key(columna,columnb)
);
Which generates this code
$this->createTable('{{%test}}', [
'columna' => 'VARCHAR(20) NOT NULL',
0 => 'PRIMARY KEY (`columna`)',
'columnb' => 'VARCHAR(20) NOT NULL',
1 => 'KEY (`columnb`)',
'columnc' => 'VARCHAR(20) NOT NULL',
], $tableOptions_mysql);
If it could work like this then better:
$this->createTable('{{%test}}', [
'columna' => Schema::TYPE_STRING . ' NOT NULL',
'columnb' => Schema::TYPE_STRING . ' NOT NULL',
'columnc' => Schema::TYPE_STRING . ' NOT NULL',
], $tableOptions_mysql);
Then add they keys now:
$this->addPrimaryKey('columna-columnb', 'news-cate', ['columna', 'columnb']);
Thanks.
from yii2-migration-utility.
Thanks, I will look into it and add an update or reply.
On Wed, Aug 10, 2016 at 11:31 PM, zeddarn [email protected] wrote:
This is the example,
create table test(
columna varchar(20) not null,
columnb varchar(20) not null,
columnc varchar(20) not null,
primary key(columna,columnb)
);Which generates this code
$this->createTable('{{%test}}', [
'columna' => 'VARCHAR(20) NOT NULL',
0 => 'PRIMARY KEY (columna
)',
'columnb' => 'VARCHAR(20) NOT NULL',
1 => 'KEY (columnb
)',
'columnc' => 'VARCHAR(20) NOT NULL',
], $tableOptions_mysql);If it could work like this then better:
$this->createTable('{{%test}}', [
'columna' => Schema::TYPE_STRING . ' NOT NULL',
'columnb' => Schema::TYPE_STRING . ' NOT NULL',
'columnc' => Schema::TYPE_STRING . ' NOT NULL',
], $tableOptions_mysql);Then add they keys now:
$this->addPrimaryKey('columna-columnb', 'news-cate', ['columna', 'columnb']);
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHVHsBn5ehnXXnZVM7XPRZJi1DIR40hiks5qesHDgaJpZM4Hpeth
.
from yii2-migration-utility.
Composite PKs have been added.
Regards
from yii2-migration-utility.
Related Issues (17)
- Error if Default column value is CURRENT_TIMESTAMP HOT 1
- Stable Release HOT 5
- Some JQuery functionalities not working HOT 4
- Multiple primary key defined HOT 3
- Missing 2 Classes on a commit cause fatal error and exception! HOT 1
- table prefix ignored HOT 1
- Tool doesn't set default value for integer if it is 0 HOT 1
- SHOW INDEX FROM executed on PostgoreSQL database HOT 5
- demo not working HOT 3
- addcslashes in insert statements HOT 1
- validateCsrfToken() issue HOT 3
- Incorrect enum options escaping and uppercase HOT 1
- Probably incorrect array check. HOT 1
- DB prefix in addForeignKey HOT 1
- good day. HOT 2
- not working HOT 2
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-utility.