# Generated by Django 3.1.5 on 2021-01-30 10:59

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('userid', models.EmailField(max_length=254, primary_key=True, serialize=False, unique=True)),
                ('nickname', models.CharField(max_length=50)),
                ('password', models.CharField(max_length=50)),
                ('role', models.CharField(default='user', max_length=10)),
            ],
            options={
                'db_table': 'bikeshareapp_user',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('LocationID', models.AutoField(primary_key=True, serialize=False)),
                ('Line1', models.CharField(max_length=200)),
                ('City', models.CharField(max_length=100)),
                ('Postcode', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'address',
            },
        ),
        migrations.CreateModel(
            name='Bike',
            fields=[
                ('BikeID', models.AutoField(primary_key=True, serialize=False)),
                ('Rent', models.FloatField()),
                ('IsAvailable', models.IntegerField()),
                ('IsDefective', models.IntegerField()),
                ('AddressLocationID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='AddressLocationID', to='bikeshareapp.address')),
            ],
            options={
                'db_table': 'bike',
            },
        ),
        migrations.CreateModel(
            name='Wallet',
            fields=[
                ('WalletID', models.AutoField(primary_key=True, serialize=False)),
                ('Credit', models.FloatField()),
                ('PaymentMethods', models.BinaryField()),
            ],
            options={
                'db_table': 'wallet',
            },
        ),
        migrations.CreateModel(
            name='Trip',
            fields=[
                ('TripID', models.AutoField(primary_key=True, serialize=False)),
                ('Date', models.DateTimeField(default=django.utils.timezone.now)),
                ('StartTime', models.DateTimeField(default=django.utils.timezone.now)),
                ('EndTime', models.DateTimeField(default=django.utils.timezone.now)),
                ('Cost', models.FloatField()),
                ('PaymentStatus', models.IntegerField()),
                ('BikeID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bikeshareapp.bike')),
                ('EndAddress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='EndAddress', to='bikeshareapp.address')),
                ('StartAddress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='StartAddress', to='bikeshareapp.address')),
            ],
            options={
                'db_table': 'trip',
            },
        ),
    ]
