Project_Camper/vagus/camper/migrations/0001_initial.py
2021-01-17 17:10:04 +01:00

84 lines
4.4 KiB
Python

# Generated by Django 3.1.3 on 2021-01-12 17:44
import camper.models
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='AlbumImage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
),
migrations.CreateModel(
name='Offer_Category',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=50)),
],
options={
'verbose_name': 'Category',
'verbose_name_plural': 'Categories',
},
),
migrations.CreateModel(
name='Offer',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('date_added', models.DateTimeField(auto_now_add=True)),
('status', models.CharField(choices=[('Active', 'Active offer'), ('Inactive', 'Inactive offer'), ('Verification', 'Waiting for verication'), ('Blocked', 'Blocked Offer')], default='Inactive', max_length=32)),
('title', models.CharField(default='Tytuł oferty', max_length=50, verbose_name='Title')),
('slug', models.SlugField(default='', editable=False, max_length=70, unique=True)),
('price', models.DecimalField(decimal_places=2, max_digits=10)),
('DMC', models.CharField(choices=[('B', 'Do 3.5 tony.'), ('C', 'Między 3.5 a 7.5 tony'), ('C1', 'Powyzej 7.5 tony')], default='B', max_length=32)),
('Places_to_sleep', models.IntegerField(default=2)),
('cooker', models.CharField(choices=[('Elecric', 'Kuchenka elektryczna'), ('Gas', 'Kuchenka gazowa'), ('None', 'Brak')], default='None', max_length=32)),
('fridge', models.BooleanField(default=False)),
('microwave', models.BooleanField(default=False)),
('Webasto', models.BooleanField(default=False)),
('auto_temp_control', models.BooleanField(default=False)),
('water_level_indicator', models.BooleanField(default=False)),
('battery_level', models.BooleanField(default=False)),
('photovoltaic_panels', models.BooleanField(default=False)),
('gearbox', models.CharField(choices=[('Manual', 'Skrzynia manualna'), ('Automat', 'Skrzynia automatyczna')], default='Manual', max_length=32)),
('tempomat', models.BooleanField(default=False)),
('album', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='album', to='camper.albumimage', verbose_name='')),
('category', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='camper.offer_category')),
('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Offer',
'verbose_name_plural': 'Offers',
},
),
migrations.CreateModel(
name='Image_offer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.ImageField(blank=True, null=True, upload_to=camper.models._upload_path)),
('main_image', models.BooleanField(default=False)),
('offer', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='images', to='camper.offer', verbose_name='')),
],
),
migrations.CreateModel(
name='Favourite_Offers',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('timestap', models.DateTimeField(auto_now_add=True, db_index=True)),
('offer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='camper.offer')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]