hi,
Thanks for you reply:
This what I get:
--------------------
[Doctrine\DBAL\DBALException]
An exception occurred while executing 'ALTER TABLE group_members ADD id
INT AUTO_INCREMENT NOT NULL, ADD joinstate INT NOT NULL, ADD isdisabled
TINYINT(1) NOT NULL,
ADD isbanned TINYINT(1) NOT
NULL':
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table
definition; there can be only one auto column and it must be defined as a
key
-------------------
I use mysql..
in entity definition I have also added:
@Table(name="group_members",
uniqueConstraints={@UniqueConstraint(name="memberspair_idx",
columns={"user_id", "group_id"})})
Thanks in advance.
--
Jnl
On Tuesday, 4 March 2014 07:45:49 UTC, Jàπ (Jasper N. Brouwer) wrote:
>
> Hi,
>
> > It fails
>
> What is the exact error message you're getting?
>
> And what database vendor are you using? (MySQL, PostgreSQL, etc)
>
> --
> Jasper N. Brouwer
> (@jaspernbrouwer)
>
>
> On 4 Mar 2014, at 00:45, janul <[email protected] <javascript:>>
> wrote:
>
> > Hi,
> > As I needed to add some new columns to my Many2Many relation I created
> new entity
> > based on existing join table.
> >
> > I have added @Id into new entity too.
> >
> > the problem happens when I'm trying to use cli to update database
> structure. It fails because adding primary key is not fired within first
> alter:
> >
> > ALTER TABLE group_members ADD id INT AUTO_INCREMENT NOT NULL, ADD
> joinstate INT NOT NULL, ADD isdisabled TINYINT(1) NOT NULL, ADD isbanned
> TINYINT(1) NOT NULL;
> > ALTER TABLE group_members ADD CONSTRAINT FK_A118B557A53A8AA FOREIGN KEY
> (user_id) REFERENCES user (id);
> > ALTER TABLE group_members ADD CONSTRAINT FK_A118B5576A03EFC5 FOREIGN KEY
> (group_id) REFERENCES group (id);
> > ALTER TABLE group_members ADD PRIMARY KEY (id);
> > CREATE UNIQUE INDEX memberspair_idx ON group_members (group_id,
> group_id)
> > --------------
> > is any work around to able use doctrine-cli without adding primary key
> manualy before?
> >
> > Thanks in advance,
> > jnl
>
>
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.