Browse Source

fix: update default value for expires_at in DatasourceProvider model

tags/2.0.0-beta.1
Harry 2 months ago
parent
commit
ada0875ac4

+ 33
- 0
api/migrations/versions/2025_08_11_1138-17d4db47800c_add_pipeline_info_16.py View File

@@ -0,0 +1,33 @@
"""datasource_oauth_refresh

Revision ID: 17d4db47800c
Revises: 223c3f882c69
Create Date: 2025-08-11 11:38:03.662874

"""
from alembic import op
import models as models
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '17d4db47800c'
down_revision = '223c3f882c69'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('datasource_providers', schema=None) as batch_op:
batch_op.add_column(sa.Column('expires_at', sa.Integer(), nullable=False, server_default='-1'))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('datasource_providers', schema=None) as batch_op:
batch_op.drop_column('expires_at')

# ### end Alembic commands ###

+ 1
- 1
api/models/oauth.py View File

@@ -37,7 +37,7 @@ class DatasourceProvider(Base):
encrypted_credentials: Mapped[dict] = db.Column(JSONB, nullable=False)
avatar_url: Mapped[str] = db.Column(db.String(255), nullable=True, default="default")
is_default: Mapped[bool] = db.Column(db.Boolean, nullable=False, server_default=db.text("false"))
expires_at: Mapped[int] = db.Column(db.Integer, nullable=False, default=-1)
expires_at: Mapped[int] = db.Column(db.Integer, nullable=False, server_default='-1')

created_at: Mapped[datetime] = db.Column(db.DateTime, nullable=False, default=datetime.now)
updated_at: Mapped[datetime] = db.Column(db.DateTime, nullable=False, default=datetime.now)

+ 15
- 0
web/.vscode/launch.json View File

@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}

Loading…
Cancel
Save