Disallow "_game" as a package name

This commit is contained in:
rubenwardy
2022-06-25 03:44:25 +01:00
parent 3b140df508
commit a8de369edf
3 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
"""empty message
Revision ID: 6e59ad5cc62a
Revises: 8425c06b7d77
Create Date: 2022-06-25 02:39:15.959553
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '6e59ad5cc62a'
down_revision = '8425c06b7d77'
branch_labels = None
depends_on = None
def upgrade():
op.drop_constraint("name_valid", "package", type_="check")
op.create_check_constraint("name_valid", "package", "name ~* '^[a-z0-9_]+$' AND name != '_game'")
def downgrade():
op.drop_constraint("name_valid", "package", type_="check")
op.create_check_constraint("name_valid", "package", "name ~* '^[a-z0-9_]+$'")