class Subscription(Base):
__tablename__ = 'subcsription'
gender = Column(GENDER_CHOICES) # Gender
auto_gender = Column(GENDER_CHOICES) # Gender
sqlalchemy.exc.ProgrammingError: (ProgrammingError) type "gender_types" already exists
"CREATE TYPE gender_types AS ENUM ('M','F')" {}
--
You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alem...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
GENDER_CHOICES = Enum('M', 'F', name='gender_types', native_enum=False)
sa.Column('gender', sa.Enum('M', 'F', native_enum=False, name='gender_types'), nullable=True),
sa.Column('auto_gender', sa.Enum('M', 'F', native_enum=False, name='gender_types'), nullable=True),
sqlalchemy.exc.ProgrammingError: (ProgrammingError) check constraint "gender_types" already exists
"\nCREATE TABLE subcsription (\n\tid SERIAL NOT NULL, \n\tcustomer_id INTEGER, \n\temail VARCHAR(150) NOT NULL, \n\tstatus status_choices NOT NULL, \n\tsms_status sms_status_choices NOT NULL, \n\tstatus_changed_at TIMESTAMP WITHOUT TIME ZONE, \n\tconfirm_code VARCHAR(50) NOT NULL, \n\tgender VARCHAR(1), \n\tauto_gender VARCHAR(1), \n\tlocation VARCHAR(255), \n\tutm_source VARCHAR(255), \n\tutm_medium VARCHAR(255), \n\tutm_campaign VARCHAR(255), \n\tutm_content VARCHAR(255), \n\tutm_term TEXT, \n\tutm_keyword VARCHAR(255), \n\turl TEXT, \n\treferer TEXT, \n\tdomain domain_choices, \n\tname VARCHAR(255), \n\tyear_of_birth INTEGER, \n\tregion VARCHAR(64), \n\tcity VARCHAR(150), \n\tcreated_at TIMESTAMP WITHOUT TIME ZONE DEFAULT 'now()' NOT NULL, \n\tupdated_at TIMESTAMP WITHOUT TIME ZONE DEFAULT 'now()' NOT NULL, \n\tPRIMARY KEY (id), \n\tFOREIGN KEY(customer_id) REFERENCES customer (id) ON DELETE CASCADE, \n\tCONSTRAINT gender_types CHECK (gender IN ('M', 'F')), \n\tCONSTRAINT gender_types CHECK (auto_gender IN ('M', 'F'))\n)\n\n" {}