Re: many to many relation with foreign key to composite primary key

2018-12-14 Thread patrick payet
Hi Mike, Thank you for the time you gave me. The other problem I had to do was that my models were distributed in different files. Alembic could not access their class and therefore could not auto-generate his file. Best regards, Le jeu. 13 déc. 2018 à 19:48, Mike Bayer a écrit : > I can't

Re: many to many relation with foreign key to composite primary key

2018-12-13 Thread Mike Bayer
I can't reproduce any problem. Filling out your mappings from your first email, these look like: from sqlalchemy import * from sqlalchemy.orm import relationship from datetime import datetime from sqlalchemy.ext.declarative import declarative_base as db target_metadata = MetaData()

Re: many to many relation with foreign key to composite primary key

2018-12-13 Thread patrick payet
Hi Mike, The message has been truncated. The CREATE TABLE statements is : CREATE TABLE users ( id BIGSERIAL NOT NULL, email VARCHAR(100) NOT NULL, name VARCHAR(100) NOT NULL, hashed_password VARCHAR(100) NOT NULL, is_admin BOOLEAN, is_active

Re: many to many relation with foreign key to composite primary key

2018-12-13 Thread Mike Bayer
On Thu, Dec 13, 2018 at 7:11 AM patrick payet wrote: > > Hi Mike, > Thanks for your answer. > My problem it’s a classical problem for application development, I want to > make authentication and authorisation for a web application. > I want to understand why Alembic can’t create the model in

Re: many to many relation with foreign key to composite primary key

2018-12-13 Thread patrick payet
Hi Mike, Thanks for your answer. My problem it’s a classical problem for application development, I want to make authentication and authorisation for a web application. I want to understand why Alembic can’t create the model in autogeneration mode and how modify this model to resolve this problem.

Re: many to many relation with foreign key to composite primary key

2018-12-12 Thread Mike Bayer
On Wed, Dec 12, 2018 at 1:01 PM patrick payet wrote: > > I had a SQLAlchemy model like - > > class User(DeclarativeBase): > __tablename__ = 'users' > > id = Column(BigInteger, primary_key=True) > email = Column(String(100), unique=True, nullable=False) > name =