Hello Kasun,

I hope the following link helps.
https://docs.djangoproject.com/en/1.4/ref/models/fields/#primary-key

Thanks.

2012/3/31 KasunLak <[email protected]>

> This is a oracle create table statements for what I wanted to do in
> django. How to get a relationship like this in django model. Is there
> a way to manually modify the generated create table statements in
> django to fulfil our needs. eg: removing id column, make one column a
> primary key of another like below. Thank you. Though the following are
> from Oracle I want to do it in mysql. this is just to show what I want
> to get.
>
> CREATE TABLE user_tab
>      ( mobileno                        VARCHAR2       NOT NULL,
>        name_                          VARCHAR2       NOT NULL,
>        town_                          VARCHAR2       NOT NULL,
>        contact_no                     VARCHAR2       NOT NULL)
> TABLESPACE &pola_data
> STORAGE (&normal)
> /
>
>
> ALTER TABLE user_tab
>   ADD ( CONSTRAINT user_pk PRIMARY KEY (mobileno)
>         USING INDEX
>               TABLESPACE &pola_index
>               STORAGE (&normal))
> /
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to