Skip to content

Commit

Permalink
Removed initial migrations to add brand new User table
Browse files Browse the repository at this point in the history
  • Loading branch information
rabinadk1 committed Oct 17, 2020
1 parent 4e1b5f7 commit a4e70f3
Show file tree
Hide file tree
Showing 22 changed files with 269 additions and 435 deletions.
133 changes: 33 additions & 100 deletions address/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,141 +1,74 @@
# Generated by Django 3.1.2 on 2020-10-17 13:47
# Generated by Django 3.1.2 on 2020-10-17 15:00

import django.db.models.deletion
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = []
dependencies = [
]

operations = [
migrations.CreateModel(
name="Country",
name='Country',
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100, unique=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True)),
],
),
migrations.CreateModel(
name="District",
name='District',
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name="Municipality",
name='Municipality',
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
(
"district",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="address.district",
),
),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('district', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='address.district')),
],
),
migrations.CreateModel(
name="Ward",
name='Ward',
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("number", models.PositiveSmallIntegerField()),
(
"municipality",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="address.municipality",
),
),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('number', models.PositiveSmallIntegerField()),
('municipality', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='address.municipality')),
],
),
migrations.CreateModel(
name="Province",
name='Province',
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
(
"country",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="address.country",
),
),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='address.country')),
],
),
migrations.AddField(
model_name="district",
name="province",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="address.province"
),
model_name='district',
name='province',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='address.province'),
),
migrations.AddConstraint(
model_name="ward",
constraint=models.UniqueConstraint(
fields=("number", "municipality"), name="unique_number_municiplaity"
),
model_name='ward',
constraint=models.UniqueConstraint(fields=('number', 'municipality'), name='unique_number_municiplaity'),
),
migrations.AddConstraint(
model_name="province",
constraint=models.UniqueConstraint(
fields=("name", "country"), name="unique_name_country"
),
model_name='province',
constraint=models.UniqueConstraint(fields=('name', 'country'), name='unique_name_country'),
),
migrations.AddConstraint(
model_name="municipality",
constraint=models.UniqueConstraint(
fields=("name", "district"), name="unique_name_district"
),
model_name='municipality',
constraint=models.UniqueConstraint(fields=('name', 'district'), name='unique_name_district'),
),
migrations.AddConstraint(
model_name="district",
constraint=models.UniqueConstraint(
fields=("name", "province"), name="unique_name_province"
),
model_name='district',
constraint=models.UniqueConstraint(fields=('name', 'province'), name='unique_name_province'),
),
]
3 changes: 3 additions & 0 deletions covaplad/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@

ALLOWED_HOSTS = []

# Extending Base User to add some fields
AUTH_USER_MODEL = "user.User"

# Application definition

INSTALLED_APPS = [
"user.apps.UserConfig",
"volunteer.apps.VolunteerConfig",
"event.apps.EventConfig",
"donor.apps.DonorConfig",
Expand Down
26 changes: 11 additions & 15 deletions donation_venue/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
# Generated by Django 3.1.2 on 2020-10-17 12:46
# Generated by Django 3.1.2 on 2020-10-17 15:00

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = []
dependencies = [
('address', '0001_initial'),
]

operations = [
migrations.CreateModel(
name="DonationVenue",
name='DonationVenue',
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
("email", models.EmailField(max_length=254, unique=True)),
("phone_number", models.BigIntegerField()),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('email', models.EmailField(max_length=254, unique=True)),
('phone_number', models.BigIntegerField()),
('address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='address.ward')),
],
),
]
25 changes: 0 additions & 25 deletions donation_venue/migrations/0002_donationvenue_address.py

This file was deleted.

81 changes: 5 additions & 76 deletions donor/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 3.1.2 on 2020-10-17 12:46
# Generated by Django 3.1.2 on 2020-10-17 15:00

import django.db.models.deletion
from django.db import migrations, models


Expand All @@ -9,85 +8,15 @@ class Migration(migrations.Migration):
initial = True

dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
("donation_venue", "0001_initial"),
]

operations = [
migrations.CreateModel(
name="Disease",
name='Disease',
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=100)),
("icd_code", models.CharField(max_length=10, unique=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('icd_code', models.CharField(max_length=10, unique=True)),
],
),
migrations.CreateModel(
name="Donor",
fields=[
(
"id",
models.OneToOneField(
db_column="id",
on_delete=django.db.models.deletion.CASCADE,
primary_key=True,
serialize=False,
to="auth.user",
),
),
(
"last_symptom_date",
models.DateField(verbose_name="covid_last_symptom_date"),
),
("blood_group", models.CharField(max_length=3)),
("test_report", models.TextField(blank=True)),
("height", models.PositiveSmallIntegerField()),
("weight", models.PositiveSmallIntegerField()),
("diseases", models.ManyToManyField(to="donor.Disease")),
],
),
migrations.CreateModel(
name="DonorRegistration",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("date_time", models.DateTimeField(auto_now=True)),
("did_donation", models.BooleanField(default=False)),
(
"donor",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="donor.donor"
),
),
(
"venue",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="donation_venue.donationvenue",
),
),
],
),
migrations.AddField(
model_name="donor",
name="venues",
field=models.ManyToManyField(
through="donor.DonorRegistration", to="donation_venue.DonationVenue"
),
),
]
34 changes: 0 additions & 34 deletions donor/migrations/0002_auto_20201017_1847.py

This file was deleted.

Loading

0 comments on commit a4e70f3

Please sign in to comment.