Skip to content

Commit e108eb9

Browse files
authored
chore: fix CI pipeline (#39)
* fix: add `.env` * fix: re-create alembic repo * chore: run `poetry update` * feat: run format checks When the stack is running, use: `docker compose exec -T backend bash /app/scripts/format.sh`
1 parent ccdd3f3 commit e108eb9

File tree

5 files changed

+640
-645
lines changed

5 files changed

+640
-645
lines changed

.github/workflows/playwright.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- name: Install Playwright Browsers
4040
run: npx playwright install --with-deps
4141
working-directory: frontend
42+
- run: cp .env.example .env
4243
- run: docker compose build
4344
- run: docker compose down -v --remove-orphans
4445
- run: docker compose up -d

backend/app/alembic/versions/119709b3f9bb_init_initial_databases.py renamed to backend/app/alembic/versions/ba1bdfec52c5_init_initial_database.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
"""init: initial databases
1+
"""init: initial database
22
3-
Revision ID: 119709b3f9bb
4-
Revises:
5-
Create Date: 2024-06-24 12:29:36.756635
3+
Revision ID: ba1bdfec52c5
4+
Revises:
5+
Create Date: 2024-08-03 22:04:39.316036
66
77
"""
88
from alembic import op
@@ -11,7 +11,7 @@
1111

1212

1313
# revision identifiers, used by Alembic.
14-
revision = '119709b3f9bb'
14+
revision = 'ba1bdfec52c5'
1515
down_revision = None
1616
branch_labels = None
1717
depends_on = None
@@ -30,17 +30,17 @@ def upgrade():
3030
sa.Column('is_active', sa.Boolean(), nullable=False),
3131
sa.Column('is_superuser', sa.Boolean(), nullable=False),
3232
sa.Column('full_name', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True),
33-
sa.Column('id', sa.Integer(), nullable=False),
33+
sa.Column('id', sa.Uuid(), nullable=False),
3434
sa.Column('hashed_password', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
3535
sa.PrimaryKeyConstraint('id')
3636
)
3737
op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
3838
op.create_table('item',
3939
sa.Column('description', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=True),
40-
sa.Column('id', sa.Integer(), nullable=False),
40+
sa.Column('id', sa.Uuid(), nullable=False),
4141
sa.Column('title', sqlmodel.sql.sqltypes.AutoString(length=255), nullable=False),
42-
sa.Column('owner_id', sa.Integer(), nullable=False),
43-
sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ),
42+
sa.Column('owner_id', sa.Uuid(), nullable=False),
43+
sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ondelete='CASCADE'),
4444
sa.PrimaryKeyConstraint('id')
4545
)
4646
op.create_table('task',
@@ -49,9 +49,9 @@ def upgrade():
4949
sa.Column('priority_id', sa.Integer(), nullable=True),
5050
sa.Column('duration', sa.Integer(), nullable=True),
5151
sa.Column('due', sa.DateTime(), nullable=True),
52-
sa.Column('id', sa.Integer(), nullable=False),
53-
sa.Column('owner_id', sa.Integer(), nullable=False),
54-
sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ),
52+
sa.Column('id', sa.Uuid(), nullable=False),
53+
sa.Column('owner_id', sa.Uuid(), nullable=False),
54+
sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ondelete='CASCADE'),
5555
sa.ForeignKeyConstraint(['priority_id'], ['priority.id'], ),
5656
sa.PrimaryKeyConstraint('id')
5757
)

backend/app/alembic/versions/c48758dce0b3_feat_add_cascade_delete_relationships.py

Lines changed: 0 additions & 77 deletions
This file was deleted.

backend/app/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ class ItemUpdate(ItemBase):
7878
class Item(ItemBase, table=True):
7979
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
8080
title: str = Field(max_length=255)
81-
owner_id: uuid.UUID = Field(foreign_key="user.id", nullable=False, ondelete="CASCADE")
81+
owner_id: uuid.UUID = Field(
82+
foreign_key="user.id", nullable=False, ondelete="CASCADE"
83+
)
8284
owner: User | None = Relationship(back_populates="items")
8385

8486

@@ -132,7 +134,9 @@ class TaskBase(SQLModel):
132134

133135
class Task(TaskBase, table=True):
134136
id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
135-
owner_id: uuid.UUID = Field(foreign_key="user.id", nullable=False, ondelete="CASCADE")
137+
owner_id: uuid.UUID = Field(
138+
foreign_key="user.id", nullable=False, ondelete="CASCADE"
139+
)
136140
owner: User | None = Relationship(back_populates="tasks")
137141

138142

0 commit comments

Comments
 (0)