Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
2ed63d9a
Commit
2ed63d9a
authored
5 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Add migrations.
parent
6f5bf674
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
migrations/versions/0fcc4cb0447b_initial.py
+15
-4
15 additions, 4 deletions
migrations/versions/0fcc4cb0447b_initial.py
migrations/versions/60d474dea68f_add_corpora_table.py
+0
-35
0 additions, 35 deletions
migrations/versions/60d474dea68f_add_corpora_table.py
with
15 additions
and
39 deletions
migrations/versions/
717796966c8c_initial_migration
.py
→
migrations/versions/
0fcc4cb0447b_initial
.py
+
15
−
4
View file @
2ed63d9a
"""
initial
migration
"""
initial
Revision ID:
717796966c8c
Revision ID:
0fcc4cb0447b
Revises:
Create Date: 2019-08-06 1
1:39:51.067875
Create Date: 2019-08-06 1
3:41:06.754193
"""
from
alembic
import
op
...
...
@@ -10,7 +10,7 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision
=
'
717796966c8c
'
revision
=
'
0fcc4cb0447b
'
down_revision
=
None
branch_labels
=
None
depends_on
=
None
...
...
@@ -30,6 +30,7 @@ def upgrade():
op
.
create_table
(
'
users
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
confirmed
'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'
registration_date
'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'
email
'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'
password_hash
'
,
sa
.
String
(
length
=
128
),
nullable
=
True
),
sa
.
Column
(
'
role_id
'
,
sa
.
Integer
(),
nullable
=
True
),
...
...
@@ -39,8 +40,17 @@ def upgrade():
)
op
.
create_index
(
op
.
f
(
'
ix_users_email
'
),
'
users
'
,
[
'
email
'
],
unique
=
True
)
op
.
create_index
(
op
.
f
(
'
ix_users_username
'
),
'
users
'
,
[
'
username
'
],
unique
=
True
)
op
.
create_table
(
'
corpora
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
description
'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'
title
'
,
sa
.
String
(
length
=
32
),
nullable
=
True
),
sa
.
Column
(
'
user_id
'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'
user_id
'
],
[
'
users.id
'
],
),
sa
.
PrimaryKeyConstraint
(
'
id
'
)
)
op
.
create_table
(
'
jobs
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
creation_date
'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'
description
'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'
ressources
'
,
sa
.
String
(
length
=
255
),
nullable
=
True
),
sa
.
Column
(
'
service
'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
...
...
@@ -57,6 +67,7 @@ def upgrade():
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_table
(
'
jobs
'
)
op
.
drop_table
(
'
corpora
'
)
op
.
drop_index
(
op
.
f
(
'
ix_users_username
'
),
table_name
=
'
users
'
)
op
.
drop_index
(
op
.
f
(
'
ix_users_email
'
),
table_name
=
'
users
'
)
op
.
drop_table
(
'
users
'
)
...
...
This diff is collapsed.
Click to expand it.
migrations/versions/60d474dea68f_add_corpora_table.py
deleted
100644 → 0
+
0
−
35
View file @
6f5bf674
"""
Add corpora table
Revision ID: 60d474dea68f
Revises: 717796966c8c
Create Date: 2019-08-06 12:03:30.639380
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
'
60d474dea68f
'
down_revision
=
'
717796966c8c
'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
create_table
(
'
corpora
'
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'
description
'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'
title
'
,
sa
.
String
(
length
=
32
),
nullable
=
True
),
sa
.
Column
(
'
user_id
'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'
user_id
'
],
[
'
users.id
'
],
),
sa
.
PrimaryKeyConstraint
(
'
id
'
)
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_table
(
'
corpora
'
)
# ### end Alembic commands ###
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment