<reponame>ppabcd/django_inventaris
# Generated by Django 2.0.13 on 2019-05-16 09:15

import datetime

import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='DetailPinjam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('jumlah', models.IntegerField()),
            ],
            options={
                'db_table': 'detail_pinjam',
            },
        ),
        migrations.CreateModel(
            name='Inventaris',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nama', models.CharField(max_length=100)),
                ('kondisi', models.CharField(max_length=100)),
                ('keterangan', models.TextField()),
                ('jumlah', models.IntegerField()),
                ('tanggal_register', models.DateField()),
                ('kode_inventaris', models.CharField(max_length=20)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'inventaris',
            },
        ),
        migrations.CreateModel(
            name='Jenis',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nama_jenis', models.CharField(max_length=100)),
                ('kode_jenis', models.CharField(max_length=100)),
                ('keterangan', models.TextField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
            ],
            options={
                'db_table': 'jenis',
            },
        ),
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField()),
                ('ipaddr', models.CharField(max_length=200)),
                ('created_at', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('update_at', models.DateTimeField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'log',
            },
        ),
        migrations.CreateModel(
            name='Pages',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('page_name', models.CharField(max_length=200)),
                ('page_route', models.CharField(max_length=200)),
                ('is_parent', models.IntegerField(blank=True, null=True)),
                ('children', models.IntegerField(blank=True, null=True)),
                ('icon', models.CharField(blank=True, max_length=20, null=True)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'pages',
            },
        ),
        migrations.CreateModel(
            name='Pegawai',
            fields=[
                ('nama_pegawai', models.CharField(max_length=100)),
                ('nip', models.CharField(max_length=20, primary_key=True, serialize=False, validators=[django.core.validators.RegexValidator('^\\d{1,10}$')])),
                ('alamat', models.TextField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
            ],
            options={
                'db_table': 'pegawai',
            },
        ),
        migrations.CreateModel(
            name='Peminjaman',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tanggal_pinjam', models.DateTimeField()),
                ('tanggal_kembali', models.DateTimeField(blank=True, null=True)),
                ('status_peminjaman', models.CharField(choices=[('0', 'Dipinjam'), ('1', 'Dikembalikan')], max_length=1)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
                ('inventaris', models.ManyToManyField(through='inventaris.DetailPinjam', to='inventaris.Inventaris')),
                ('pegawai', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Pegawai')),
            ],
            options={
                'db_table': 'peminjaman',
            },
        ),
        migrations.CreateModel(
            name='Ruang',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nama_ruang', models.CharField(max_length=100)),
                ('kode_ruang', models.CharField(max_length=100)),
                ('keterangan', models.TextField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'ruang',
            },
        ),
        migrations.CreateModel(
            name='Settings',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('website_name', models.CharField(max_length=200)),
                ('dashboard_text', models.TextField(blank=True, null=True)),
                ('logo', models.CharField(blank=True, max_length=100, null=True)),
                ('favicon', models.CharField(blank=True, max_length=100, null=True)),
                ('automatic_code', models.IntegerField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'settings',
            },
        ),
        migrations.AddField(
            model_name='inventaris',
            name='jenis',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Jenis'),
        ),
        migrations.AddField(
            model_name='inventaris',
            name='ruang',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Ruang'),
        ),
        migrations.AddField(
            model_name='inventaris',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='detailpinjam',
            name='inventaris',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Inventaris'),
        ),
        migrations.AddField(
            model_name='detailpinjam',
            name='peminjaman',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Peminjaman'),
        ),
    ]

# Generated by Django 2.0.13 on 2019-05-16 09:15

import datetime

import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='DetailPinjam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('jumlah', models.IntegerField()),
            ],
            options={
                'db_table': 'detail_pinjam',
            },
        ),
        migrations.CreateModel(
            name='Inventaris',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nama', models.CharField(max_length=100)),
                ('kondisi', models.CharField(max_length=100)),
                ('keterangan', models.TextField()),
                ('jumlah', models.IntegerField()),
                ('tanggal_register', models.DateField()),
                ('kode_inventaris', models.CharField(max_length=20)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'inventaris',
            },
        ),
        migrations.CreateModel(
            name='Jenis',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nama_jenis', models.CharField(max_length=100)),
                ('kode_jenis', models.CharField(max_length=100)),
                ('keterangan', models.TextField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
            ],
            options={
                'db_table': 'jenis',
            },
        ),
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField()),
                ('ipaddr', models.CharField(max_length=200)),
                ('created_at', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('update_at', models.DateTimeField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'log',
            },
        ),
        migrations.CreateModel(
            name='Pages',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('page_name', models.CharField(max_length=200)),
                ('page_route', models.CharField(max_length=200)),
                ('is_parent', models.IntegerField(blank=True, null=True)),
                ('children', models.IntegerField(blank=True, null=True)),
                ('icon', models.CharField(blank=True, max_length=20, null=True)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'pages',
            },
        ),
        migrations.CreateModel(
            name='Pegawai',
            fields=[
                ('nama_pegawai', models.CharField(max_length=100)),
                ('nip', models.CharField(max_length=20, primary_key=True, serialize=False, validators=[django.core.validators.RegexValidator('^\\d{1,10}$')])),
                ('alamat', models.TextField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
            ],
            options={
                'db_table': 'pegawai',
            },
        ),
        migrations.CreateModel(
            name='Peminjaman',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tanggal_pinjam', models.DateTimeField()),
                ('tanggal_kembali', models.DateTimeField(blank=True, null=True)),
                ('status_peminjaman', models.CharField(choices=[('0', 'Dipinjam'), ('1', 'Dikembalikan')], max_length=1)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
                ('inventaris', models.ManyToManyField(through='inventaris.DetailPinjam', to='inventaris.Inventaris')),
                ('pegawai', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Pegawai')),
            ],
            options={
                'db_table': 'peminjaman',
            },
        ),
        migrations.CreateModel(
            name='Ruang',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nama_ruang', models.CharField(max_length=100)),
                ('kode_ruang', models.CharField(max_length=100)),
                ('keterangan', models.TextField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'ruang',
            },
        ),
        migrations.CreateModel(
            name='Settings',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('website_name', models.CharField(max_length=200)),
                ('dashboard_text', models.TextField(blank=True, null=True)),
                ('logo', models.CharField(blank=True, max_length=100, null=True)),
                ('favicon', models.CharField(blank=True, max_length=100, null=True)),
                ('automatic_code', models.IntegerField()),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'settings',
            },
        ),
        migrations.AddField(
            model_name='inventaris',
            name='jenis',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Jenis'),
        ),
        migrations.AddField(
            model_name='inventaris',
            name='ruang',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Ruang'),
        ),
        migrations.AddField(
            model_name='inventaris',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='detailpinjam',
            name='inventaris',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Inventaris'),
        ),
        migrations.AddField(
            model_name='detailpinjam',
            name='peminjaman',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventaris.Peminjaman'),
        ),
    ]
# Generated by Django 2.0.13 on 2019-05-16 09:15