-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ch:migrations -- add initial migrations
- Loading branch information
1 parent
36da373
commit 325826e
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 3.2 on 2022-06-08 19:28 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Neighborhood', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=55)), | ||
('location', models.CharField(max_length=55)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('admin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='admin', to=settings.AUTH_USER_MODEL)), | ||
('occupants', models.ManyToManyField(related_name='occupants', to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
neighborhoods/migrations/0002_alter_neighborhood_occupants.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.2 on 2022-06-08 20:04 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('neighborhoods', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='neighborhood', | ||
name='occupants', | ||
field=models.ManyToManyField(blank=True, related_name='occupants', to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 3.2 on 2022-06-09 12:12 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('neighborhoods', '0002_alter_neighborhood_occupants'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='neighborhood', | ||
name='admin', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 3.2 on 2022-06-09 20:18 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('neighborhoods', '0003_alter_neighborhood_admin'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='neighborhood', | ||
name='updated_at', | ||
field=models.DateTimeField(auto_now=True), | ||
), | ||
migrations.RemoveField( | ||
model_name='neighborhood', | ||
name='occupants', | ||
), | ||
migrations.AddField( | ||
model_name='neighborhood', | ||
name='occupants', | ||
field=models.IntegerField(blank=True, default=1), | ||
), | ||
] |
Empty file.