Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ def upgrade():
op.execute("UPDATE \"user\" SET is_admin = false")

# Then, set users with @airweave.ai email to is_admin = true
op.execute("UPDATE \"user\" SET is_admin = true WHERE email LIKE '%@airweave.ai' OR email = '[email protected]'")
# For non-production environments, also grant admin to test account
from airweave.core.config import settings
if settings.ENVIRONMENT != 'prd':
op.execute("UPDATE \"user\" SET is_admin = true WHERE email LIKE '%@airweave.ai' OR email = '[email protected]'")
else:
op.execute("UPDATE \"user\" SET is_admin = true WHERE email LIKE '%@airweave.ai'")

# Now make the column NOT NULL
op.alter_column('user', 'is_admin', nullable=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ def upgrade():
op.execute("UPDATE \"user\" SET is_admin = false")

# Then, set users with @airweave.ai email to is_admin = true
op.execute("UPDATE \"user\" SET is_admin = true WHERE email LIKE '%@airweave.ai' OR email = '[email protected]'")
# For non-production environments, also grant admin to test account
from airweave.core.config import settings
if settings.ENVIRONMENT != 'prd':
op.execute("UPDATE \"user\" SET is_admin = true WHERE email LIKE '%@airweave.ai' OR email = '[email protected]'")
else:
op.execute("UPDATE \"user\" SET is_admin = true WHERE email LIKE '%@airweave.ai'")

# Now make the column NOT NULL
op.alter_column('user', 'is_admin', nullable=False)
Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ services:
- POSTGRES_USER=airweave
- POSTGRES_PASSWORD=airweave1234!
- POSTGRES_DB=airweave
# DEV/TEST ONLY: Default superuser credentials for local development and testing
# NEVER use these credentials in production - use Azure Key Vault secrets instead
- [email protected]
- FIRST_SUPERUSER_PASSWORD=admin
- ENCRYPTION_KEY="SpgLrrEEgJ/7QdhSMSvagL1juEY5eoyCG0tZN7OSQV0="
Expand Down
Loading