-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path2a6ea95342dc_blog_posts.py
More file actions
34 lines (25 loc) · 1.02 KB
/
2a6ea95342dc_blog_posts.py
File metadata and controls
34 lines (25 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""blog_posts
Revision ID: 2a6ea95342dc
Revises: 43f71e4bd6fc
Create Date: 2024-08-31 03:06:11.516362
"""
from collections.abc import Sequence
from typing import Union
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "2a6ea95342dc"
down_revision: str | None = "166f3772fce7"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
op.create_table("blog_posts",
sa.Column("title", sa.String(length=128), primary_key=True, nullable=False),
sa.Column("computing_id", sa.String(length=32), sa.ForeignKey("officer_info.computing_id"), nullable=False),
sa.Column("date_created", sa.DateTime(timezone=True), nullable=False),
sa.Column("last_edited", sa.DateTime(timezone=True), nullable=False),
sa.Column("html_content", sa.Text(), nullable=False),
sa.Column("post_tags", sa.String(length=128), nullable=True),
)
def downgrade() -> None:
op.drop_table("blog_posts")