mypertamina-microsite-api/microsite_api/location/migrations/0001_initial.py

67 lines
3.1 KiB
Python

# Generated by Django 6.0.2 on 2026-02-26 02:34
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Province',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('restored_at', models.DateTimeField(blank=True, null=True)),
('transaction_id', models.UUIDField(blank=True, null=True)),
('code', models.CharField(max_length=2, unique=True)),
('name', models.CharField(max_length=255)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='RegencyCity',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('restored_at', models.DateTimeField(blank=True, null=True)),
('transaction_id', models.UUIDField(blank=True, null=True)),
('code', models.CharField(max_length=4, unique=True)),
('name', models.CharField(max_length=255)),
('province', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.province')),
],
options={
'unique_together': {('code', 'province')},
},
),
migrations.CreateModel(
name='Location',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('deleted_at', models.DateTimeField(blank=True, null=True)),
('restored_at', models.DateTimeField(blank=True, null=True)),
('transaction_id', models.UUIDField(blank=True, null=True)),
('name', models.CharField(max_length=255)),
('path', models.TextField(blank=True, null=True)),
('totem_latitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
('totem_longitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
('totem_code', models.CharField(blank=True, max_length=50, null=True)),
('active', models.BooleanField(default=True)),
('province', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='location.province')),
('regency_city', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='location.regencycity')),
],
options={
'abstract': False,
},
),
]