Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project Allocator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edtech
Project Allocator
Commits
10472aec
Commit
10472aec
authored
2 years ago
by
Ivan Procaccini
Browse files
Options
Downloads
Patches
Plain Diff
Chore: Add initial migration script
parent
a544853f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
migrations/versions/446754d1f481_initial_migration.py
+49
-0
49 additions, 0 deletions
migrations/versions/446754d1f481_initial_migration.py
with
49 additions
and
0 deletions
migrations/versions/446754d1f481_initial_migration.py
0 → 100644
+
49
−
0
View file @
10472aec
"""
Initial migration
Revision ID: 446754d1f481
Revises:
Create Date: 2022-08-22 13:36:08.712644
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
"
446754d1f481
"
down_revision
=
None
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
create_table
(
"
authenticated_user
"
,
sa
.
Column
(
"
username
"
,
sa
.
String
(
length
=
10
),
nullable
=
False
),
sa
.
Column
(
"
firstname
"
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
"
surname
"
,
sa
.
String
(),
nullable
=
True
),
sa
.
PrimaryKeyConstraint
(
"
username
"
),
)
op
.
create_table
(
"
project
"
,
sa
.
Column
(
"
id
"
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
"
proposer
"
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
"
title
"
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
"
description
"
,
sa
.
String
(),
nullable
=
True
),
sa
.
Column
(
"
timestamp
"
,
sa
.
DateTime
(),
server_default
=
sa
.
text
(
"
TIMEZONE(
'
utc
'
, CURRENT_TIMESTAMP)
"
),
nullable
=
False
,
),
sa
.
PrimaryKeyConstraint
(
"
id
"
),
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_table
(
"
project
"
)
op
.
drop_table
(
"
authenticated_user
"
)
# ### 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