Browse Source

removed unique constraints

master
junikimm717 1 year ago
parent
commit
831b655295
  1. 8
      app.py
  2. 34
      migrations/versions/6249fce1ead9_.py

8
app.py

@ -48,12 +48,12 @@ class ModelForm(BaseModelForm):
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String, unique=True, nullable=False)
email = db.Column(db.String, unique=True, nullable=False)
name = db.Column(db.String, unique=True, nullable=False)
email = db.Column(db.String, nullable=False)
name = db.Column(db.String, nullable=False)
password = db.Column(db.String, nullable=False)
institution = db.Column(db.String, unique=True, nullable=False)
position = db.Column(db.String, unique=True, nullable=False)
institution = db.Column(db.String, nullable=False)
position = db.Column(db.String, nullable=False)
admin = db.Column(db.Boolean)

34
migrations/versions/6249fce1ead9_.py

@ -0,0 +1,34 @@
"""empty message
Revision ID: 6249fce1ead9
Revises: 282564545160
Create Date: 2023-05-22 11:28:00.309973
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6249fce1ead9'
down_revision = '282564545160'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('chemical', schema=None) as batch_op:
batch_op.add_column(sa.Column('person_id', sa.Integer(), nullable=False))
batch_op.drop_column('person_name')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('chemical', schema=None) as batch_op:
batch_op.add_column(sa.Column('person_name', sa.VARCHAR(), nullable=False))
batch_op.drop_column('person_id')
# ### end Alembic commands ###
Loading…
Cancel
Save