Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MBetterd
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
Mbetter
MBetterd
Commits
714dd3ac
Commit
714dd3ac
authored
Feb 03, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add migration file for allowing null match_number
parent
664d9e9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
allow_null_match_number.py
app/database/migrations/allow_null_match_number.py
+28
-0
No files found.
app/database/migrations/allow_null_match_number.py
0 → 100644
View file @
714dd3ac
"""Migration to allow match_number to be null in bets, bet_details, extraction_stats, and match_reports tables."""
from
app.database
import
manager
from
app
import
db
def
upgrade
():
"""Upgrade the database to allow match_number to be null."""
with
manager
.
get_alembic_context
()
.
begin_transaction
():
# Alter bets table
db
.
engine
.
execute
(
'ALTER TABLE bets MODIFY match_number INT NULL'
)
# Alter bet_details table
db
.
engine
.
execute
(
'ALTER TABLE bet_details MODIFY match_number INT NULL'
)
# Alter extraction_stats table
db
.
engine
.
execute
(
'ALTER TABLE extraction_stats MODIFY match_number INT NULL'
)
# Alter match_reports table
db
.
engine
.
execute
(
'ALTER TABLE match_reports MODIFY match_number INT NULL'
)
def
downgrade
():
"""Downgrade the database to make match_number not null."""
with
manager
.
get_alembic_context
()
.
begin_transaction
():
# Alter bets table
db
.
engine
.
execute
(
'ALTER TABLE bets MODIFY match_number INT NOT NULL'
)
# Alter bet_details table
db
.
engine
.
execute
(
'ALTER TABLE bet_details MODIFY match_number INT NOT NULL'
)
# Alter extraction_stats table
db
.
engine
.
execute
(
'ALTER TABLE extraction_stats MODIFY match_number INT NOT NULL'
)
# Alter match_reports table
db
.
engine
.
execute
(
'ALTER TABLE match_reports MODIFY match_number INT NOT NULL'
)
\ No newline at end of file
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