Skip to content

Commit

Permalink
db: github link alembic migration
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangvi7 committed Oct 18, 2024
1 parent 846ac5e commit 3d730a1
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "querybook",
"version": "3.34.2",
"version": "3.35.0",
"description": "A Big Data Webapp",
"private": true,
"scripts": {
Expand Down
52 changes: 52 additions & 0 deletions querybook/migrations/versions/a8bb37120302_add_github_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""Add Github Link
Revision ID: a8bb37120302
Revises: f7b11b3e3a95
Create Date: 2024-10-18 15:50:51.471760
"""

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = "a8bb37120302"
down_revision = "f7b11b3e3a95"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"github_link",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("datadoc_id", sa.Integer(), nullable=False),
sa.Column("user_id", sa.Integer(), nullable=False),
sa.Column("repo_url", sa.String(length=255), nullable=False),
sa.Column("branch", sa.String(length=255), nullable=False),
sa.Column("file_path", sa.String(length=255), nullable=False),
sa.Column(
"created_at", sa.DateTime(), server_default=sa.text("now()"), nullable=False
),
sa.Column(
"updated_at", sa.DateTime(), server_default=sa.text("now()"), nullable=False
),
sa.ForeignKeyConstraint(
["datadoc_id"],
["data_doc.id"],
),
sa.ForeignKeyConstraint(
["user_id"],
["user.id"],
),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("datadoc_id"),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("github_link")
# ### end Alembic commands ###

0 comments on commit 3d730a1

Please sign in to comment.