Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
fastapi
Project
Project
Details
Activity
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
Roman Desyatskii
fastapi
Commits
f5516214
Commit
f5516214
authored
Jan 04, 2024
by
Roman Desyatskii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrations
parent
e32f42c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
1_20240104193738_None.py
src/migrations/models/1_20240104193738_None.py
+20
-0
2_20240104194248_update.py
src/migrations/models/2_20240104194248_update.py
+21
-0
No files found.
src/migrations/models/1_20240104193738_None.py
0 → 100644
View file @
f5516214
from
tortoise
import
BaseDBAsyncClient
async
def
upgrade
(
db
:
BaseDBAsyncClient
)
->
str
:
return
"""
CREATE TABLE IF NOT EXISTS "aerich" (
"id" SERIAL NOT NULL PRIMARY KEY,
"version" VARCHAR(255) NOT NULL,
"app" VARCHAR(100) NOT NULL,
"content" JSONB NOT NULL
);
CREATE TABLE IF NOT EXISTS "article" (
"id" SERIAL NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL
);"""
async
def
downgrade
(
db
:
BaseDBAsyncClient
)
->
str
:
return
"""
"""
src/migrations/models/2_20240104194248_update.py
0 → 100644
View file @
f5516214
from
tortoise
import
BaseDBAsyncClient
async
def
upgrade
(
db
:
BaseDBAsyncClient
)
->
str
:
return
"""
CREATE TABLE IF NOT EXISTS "person" (
"id" SERIAL NOT NULL PRIMARY KEY,
"name" VARCHAR(255),
"birth_date" DATE
);
CREATE TABLE IF NOT EXISTS "genre" (
"id" SERIAL NOT NULL PRIMARY KEY,
"name" VARCHAR(255) NOT NULL UNIQUE,
"description" TEXT
);"""
async
def
downgrade
(
db
:
BaseDBAsyncClient
)
->
str
:
return
"""
DROP TABLE IF EXISTS "person";
DROP TABLE IF EXISTS "genre";"""
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