Created
July 12, 2020 22:24
-
-
Save alastair/a3d5df38d0ed1d215460c82e73408aa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class MyTable(models.Model): | |
field_one = models.CharField(max_length=5000, blank=True, null=False, default="") | |
field_one = models.IntegerField(default=0) | |
class Meta: | |
managed = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/app # python manage.py makemigrations test | |
Migrations for 'test': | |
test/migrations/0001_initial.py | |
- Create model MyTable | |
/app # python manage.py makemigrations test | |
Migrations for 'test': | |
test/migrations/0002_auto_20200712_2222.py | |
- Change Meta options on mytable | |
/app # python manage.py sqlmigrate test 0001 | |
BEGIN; | |
-- | |
-- Create model MyTable | |
-- | |
COMMIT; | |
/app # python manage.py sqlmigrate test 0002 | |
BEGIN; | |
-- | |
-- Change Meta options on mytable | |
-- | |
COMMIT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by Django 2.2.13 on 2020-07-12 22:22 | |
from django.db import migrations, models | |
class Migration(migrations.Migration): | |
initial = True | |
dependencies = [ | |
] | |
operations = [ | |
migrations.CreateModel( | |
name='MyTable', | |
fields=[ | |
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | |
('field_one', models.IntegerField(default=0)), | |
], | |
options={ | |
'managed': False, | |
}, | |
), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by Django 2.2.13 on 2020-07-12 22:22 | |
from django.db import migrations | |
class Migration(migrations.Migration): | |
dependencies = [ | |
('test', '0001_initial'), | |
] | |
operations = [ | |
migrations.AlterModelOptions( | |
name='mytable', | |
options={}, | |
), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class MyTable(models.Model): | |
field_one = models.CharField(max_length=5000, blank=True, null=False, default="") | |
field_one = models.IntegerField(default=0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment