[
https://issues.apache.org/jira/browse/METAMODEL-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14481430#comment-14481430
]
ASF GitHub Bot commented on METAMODEL-131:
------------------------------------------
GitHub user narahari92 opened a pull request:
https://github.com/apache/metamodel/pull/14
METAMODEL-131 defect fix
Hi,
I have made following changes to support creating tables with composite
primary key. In unit test cases where sql statement is compared as string, I
have made necessary changes. Please review.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/narahari92/metamodel METAMODEL-131
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metamodel/pull/14.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14
----
commit 7a2e335c898aaa545ac77ebe4df65cfc889f35f8
Author: Hosur Narahari <[email protected]>
Date: 2015-04-06T16:59:11Z
METAMODEL-131 defect fix
----
> Create table with composite primary key gives error.
> ----------------------------------------------------
>
> Key: METAMODEL-131
> URL: https://issues.apache.org/jira/browse/METAMODEL-131
> Project: Apache MetaModel
> Issue Type: Bug
> Reporter: Hosur Narahari
>
> Creating table with primary key is not possible since while generating sql we
> add "PRIMARY KEY" keyword to each column which results in error in case of
> composite primary keys. Below is the code.
> context.executeUpdate(new UpdateScript() {
>
> @Override
> public void run(UpdateCallback callback) {
> callback.createTable("amass", "test").
>
> withColumn("id").ofType(ColumnType.INTEGER).ofSize(16).asPrimaryKey()
>
> .withColumn("name").ofType(ColumnType.VARCHAR).ofSize(255).asPrimaryKey()
> .execute();
> }
> });
> I am using mysql. Am I using it in the wrong way?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)