# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-22 12:44
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Caracteristique',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('taille', models.SmallIntegerField(blank=True, null=True)),
                ('marque', models.CharField(max_length=60)),
                ('ram', models.SmallIntegerField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
            ],
            options={
                'db_table': 'caracteristique',
            },
        ),
        migrations.CreateModel(
            name='Catalogue',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=60)),
                ('image', models.ImageField(blank=True, null=True, upload_to='catalogues')),
            ],
            options={
                'db_table': 'catalogue',
            },
        ),
        migrations.CreateModel(
            name='Categorie',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=60)),
                ('image', models.ImageField(blank=True, null=True, upload_to='categories')),
            ],
            options={
                'verbose_name': 'categorie',
                'db_table': 'categorie',
                'verbose_name_plural': 'categorie',
            },
        ),
        migrations.CreateModel(
            name='Guide',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titre', models.CharField(blank=True, max_length=254, null=True)),
                ('description', models.TextField()),
                ('catalogue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.Catalogue')),
            ],
            options={
                'verbose_name': 'guide',
                'db_table': 'guide',
                'verbose_name_plural': 'guide',
            },
        ),
        migrations.CreateModel(
            name='ImagesProduit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image1', models.ImageField(upload_to='produits')),
                ('image2', models.ImageField(blank=True, null=True, upload_to='produits')),
                ('image3', models.ImageField(blank=True, null=True, upload_to='produits')),
                ('image4', models.ImageField(blank=True, null=True, upload_to='produits')),
            ],
            options={
                'db_table': 'images_produit',
            },
        ),
        migrations.CreateModel(
            name='Magasin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=60)),
                ('ville', models.CharField(max_length=60)),
                ('quartier', models.CharField(max_length=60)),
                ('numero_telephone', models.SmallIntegerField()),
                ('email', models.EmailField(max_length=254)),
                ('url_site', models.URLField(blank=True, null=True)),
                ('logo', models.ImageField(blank=True, null=True, upload_to='logos_magasins')),
            ],
            options={
                'verbose_name': 'magasin',
                'db_table': 'magasin',
                'verbose_name_plural': 'magasin',
            },
        ),
        migrations.CreateModel(
            name='Offre',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('notation', models.FloatField()),
                ('description', models.TextField(blank=True, null=True)),
                ('prix', models.FloatField()),
                ('url_produit', models.URLField(blank=True, null=True)),
                ('magasin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.Magasin')),
            ],
            options={
                'verbose_name': 'offre',
                'db_table': 'offre',
                'verbose_name_plural': 'offre',
            },
        ),
        migrations.CreateModel(
            name='Produit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=200)),
                ('catalogue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.Catalogue')),
            ],
            options={
                'db_table': 'produit',
            },
        ),
        migrations.CreateModel(
            name='Promotion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('image', models.ImageField(upload_to='promotions')),
                ('pourcentage', models.SmallIntegerField()),
                ('date_debut', models.DateField(auto_now=True)),
                ('date_validite', models.DateField()),
                ('catalogue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.Catalogue')),
            ],
            options={
                'db_table': 'promotion',
            },
        ),
        migrations.CreateModel(
            name='SousCategorie',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=60)),
                ('image', models.ImageField(blank=True, null=True, upload_to='souscategories')),
                ('categorie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.Categorie')),
            ],
            options={
                'db_table': 'sous_categorie',
            },
        ),
        migrations.AddField(
            model_name='offre',
            name='produit',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.Produit'),
        ),
        migrations.AddField(
            model_name='magasin',
            name='produits',
            field=models.ManyToManyField(through='products.Offre', to='products.Produit'),
        ),
        migrations.AddField(
            model_name='imagesproduit',
            name='produit',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='products.Produit'),
        ),
        migrations.AddField(
            model_name='catalogue',
            name='souscategorie',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.SousCategorie'),
        ),
        migrations.AddField(
            model_name='caracteristique',
            name='produit',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='products.Produit'),
        ),
    ]
