Skip to content

Commit 15f3e02

Browse files
Merge pull request #183 from loadsmart/big-int-migration
chore: Migration to alter Integer to BigInt
2 parents 14e6306 + a0bf09b commit 15f3e02

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

jaiminho/migrations/0006_alter_event_id.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
class Migration(migrations.Migration):
77

88
dependencies = [
9-
('jaiminho', '0005_event_strategy'),
9+
("jaiminho", "0005_event_strategy"),
1010
]
1111

1212
operations = [
1313
migrations.AlterField(
14-
model_name='event',
15-
name='id',
14+
model_name="event",
15+
name="id",
1616
field=models.BigAutoField(primary_key=True, serialize=False),
1717
),
1818
]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Generated by Django 4.1.7 on 2024-11-01 14:40
2+
3+
from django.db import migrations, connection
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("jaiminho", "0006_alter_event_id"),
10+
]
11+
12+
operations = []
13+
14+
if connection.vendor == "postgresql":
15+
operations.append(
16+
migrations.RunSQL(
17+
"ALTER TABLE jaiminho_event ALTER COLUMN id TYPE BIGINT;",
18+
)
19+
)
20+
elif connection.vendor == "mysql":
21+
operations.append(
22+
migrations.RunSQL(
23+
"ALTER TABLE jaiminho_event MODIFY id BIGINT;",
24+
)
25+
)

0 commit comments

Comments
 (0)