Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
e0c1d94f
Commit
e0c1d94f
authored
Jun 06, 2023
by
jyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add db migrations
parent
e08af0a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
e32f6ccb87c6_e08af0a69ccefbb59fa80c778efee300bb780980.py
.../e32f6ccb87c6_e08af0a69ccefbb59fa80c778efee300bb780980.py
+46
-0
No files found.
api/migrations/versions/e32f6ccb87c6_e08af0a69ccefbb59fa80c778efee300bb780980.py
0 → 100644
View file @
e0c1d94f
"""e08af0a69ccefbb59fa80c778efee300bb780980
Revision ID: e32f6ccb87c6
Revises: a45f4dfde53b
Create Date: 2023-06-06 19:58:33.103819
"""
from
alembic
import
op
import
sqlalchemy
as
sa
from
sqlalchemy.dialects
import
postgresql
# revision identifiers, used by Alembic.
revision
=
'e32f6ccb87c6'
down_revision
=
'a45f4dfde53b'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
create_table
(
'data_source_bindings'
,
sa
.
Column
(
'id'
,
postgresql
.
UUID
(),
server_default
=
sa
.
text
(
'uuid_generate_v4()'
),
nullable
=
False
),
sa
.
Column
(
'tenant_id'
,
postgresql
.
UUID
(),
nullable
=
False
),
sa
.
Column
(
'access_token'
,
sa
.
String
(
length
=
255
),
nullable
=
False
),
sa
.
Column
(
'provider'
,
sa
.
String
(
length
=
255
),
nullable
=
False
),
sa
.
Column
(
'source_info'
,
postgresql
.
JSONB
(
astext_type
=
sa
.
Text
()),
nullable
=
False
),
sa
.
Column
(
'created_at'
,
sa
.
DateTime
(),
server_default
=
sa
.
text
(
'CURRENT_TIMESTAMP(0)'
),
nullable
=
False
),
sa
.
Column
(
'updated_at'
,
sa
.
DateTime
(),
server_default
=
sa
.
text
(
'CURRENT_TIMESTAMP(0)'
),
nullable
=
False
),
sa
.
Column
(
'disabled'
,
sa
.
Boolean
(),
server_default
=
sa
.
text
(
'false'
),
nullable
=
True
),
sa
.
PrimaryKeyConstraint
(
'id'
,
name
=
'source_binding_pkey'
)
)
with
op
.
batch_alter_table
(
'data_source_bindings'
,
schema
=
None
)
as
batch_op
:
batch_op
.
create_index
(
'source_binding_tenant_id_idx'
,
[
'tenant_id'
],
unique
=
False
)
batch_op
.
create_index
(
'source_info_idx'
,
[
'source_info'
],
unique
=
False
,
postgresql_using
=
'gin'
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
with
op
.
batch_alter_table
(
'data_source_bindings'
,
schema
=
None
)
as
batch_op
:
batch_op
.
drop_index
(
'source_info_idx'
,
postgresql_using
=
'gin'
)
batch_op
.
drop_index
(
'source_binding_tenant_id_idx'
)
op
.
drop_table
(
'data_source_bindings'
)
# ### end Alembic commands ###
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment