Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chiefs
ChiefSend
Commits
3f3cf943
Commit
3f3cf943
authored
Jan 02, 2021
by
contabo-server
Browse files
initial migration script
parent
e55851f1
Changes
1
Show whitespace changes
Inline
Side-by-side
migrations/versions/5834713e12c7_.py
0 → 100644
View file @
3f3cf943
"""empty message
Revision ID: 5834713e12c7
Revises:
Create Date: 2021-01-02 00:33:24.947857
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
'5834713e12c7'
down_revision
=
None
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
create_table
(
'Share'
,
sa
.
Column
(
'ID'
,
sa
.
String
(
length
=
64
),
nullable
=
False
),
sa
.
Column
(
'Name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'Expires'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'DownloadLimit'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'Public'
,
sa
.
Boolean
(),
nullable
=
False
),
sa
.
Column
(
'Password'
,
sa
.
String
(),
nullable
=
True
),
sa
.
PrimaryKeyConstraint
(
'ID'
),
sa
.
UniqueConstraint
(
'ID'
)
)
op
.
create_table
(
'Attachment'
,
sa
.
Column
(
'ID'
,
sa
.
INTEGER
(),
nullable
=
False
),
sa
.
Column
(
'filename'
,
sa
.
String
(),
nullable
=
False
),
sa
.
Column
(
'ShareID'
,
sa
.
String
(
length
=
64
),
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'ShareID'
],
[
'Share.ID'
],
),
sa
.
PrimaryKeyConstraint
(
'ID'
),
sa
.
UniqueConstraint
(
'ID'
)
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_table
(
'Attachment'
)
op
.
drop_table
(
'Share'
)
# ### end Alembic commands ###
Write
Preview
Supports
Markdown
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