mirror of
https://github.com/godotengine/godot-showreel-voting.git
synced 2026-09-03 18:15:13 +03:00
make username not unique
This commit is contained in:
@@ -34,7 +34,7 @@ class User(DB.Model):
|
||||
|
||||
id: Mapped[str] = mapped_column(String(KEYCLOAK_ID_SIZE), primary_key=True, autoincrement=False)
|
||||
email: Mapped[str] = mapped_column(String(128), unique=True, nullable=False)
|
||||
username: Mapped[str] = mapped_column(String(150), unique=True, nullable=True)
|
||||
username: Mapped[str] = mapped_column(String(150), unique=False, nullable=True)
|
||||
|
||||
is_staff: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
||||
|
||||
32
migrations/versions/7c6cc24c9d34_.py
Normal file
32
migrations/versions/7c6cc24c9d34_.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 7c6cc24c9d34
|
||||
Revises: 727eb738db92
|
||||
Create Date: 2026-08-05 12:54:04.147726
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '7c6cc24c9d34'
|
||||
down_revision = '727eb738db92'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.drop_constraint(batch_op.f('uq_users_username'), type_='unique')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.create_unique_constraint(batch_op.f('uq_users_username'), ['username'])
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user