Skip to content

Commit

Permalink
ch:migrations -- add initial migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMwevi committed Jun 16, 2022
1 parent 36da373 commit 325826e
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 0 deletions.
28 changes: 28 additions & 0 deletions neighborhoods/migrations/0001_initial.py
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 neighborhoods/migrations/0002_alter_neighborhood_occupants.py
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),
),
]
21 changes: 21 additions & 0 deletions neighborhoods/migrations/0003_alter_neighborhood_admin.py
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),
),
]
27 changes: 27 additions & 0 deletions neighborhoods/migrations/0004_auto_20220609_2318.py
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.

0 comments on commit 325826e

Please sign in to comment.