first commit
This commit is contained in:
28
dashboard/migrations/0001_initial.py
Normal file
28
dashboard/migrations/0001_initial.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 4.2.30 on 2026-08-20 02:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='KwhReadings',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('timestamp', models.DateTimeField(auto_now_add=True)),
|
||||
('voltage', models.FloatField(help_text='Tegangan (V)')),
|
||||
('current', models.FloatField(help_text='Arus (A)')),
|
||||
('active_power', models.FloatField(help_text='Daya Aktif (kW)')),
|
||||
('total_energy', models.FloatField(help_text='Total kWh')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-timestamp'],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 4.2.30 on 2026-08-31 08:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='kwhreadings',
|
||||
options={},
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='kwhreadings',
|
||||
index=models.Index(fields=['-id'], name='dashboard_k_id_6c2fc9_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='kwhreadings',
|
||||
index=models.Index(fields=['-timestamp'], name='dashboard_k_timesta_992091_idx'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,59 @@
|
||||
# Generated by Django 4.2.30 on 2026-09-01 15:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0002_alter_kwhreadings_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='kwhreadings',
|
||||
name='active_power',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='kwhreadings',
|
||||
name='current',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='kwhreadings',
|
||||
name='total_energy',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='kwhreadings',
|
||||
name='voltage',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='kwhreadings',
|
||||
name='active_power_kwh',
|
||||
field=models.FloatField(default=0, help_text='Total kWh Accumulation'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='kwhreadings',
|
||||
name='apparent_power_va',
|
||||
field=models.FloatField(default=0, help_text='Apparent Power / Voltage (VA)'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='kwhreadings',
|
||||
name='power_factor',
|
||||
field=models.FloatField(default=0, help_text='Power Factor'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='kwhreadings',
|
||||
name='real_active_power_kw',
|
||||
field=models.FloatField(default=0, help_text='Calculated Active Power (kW)'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='kwhreadings',
|
||||
name='total_current_a',
|
||||
field=models.FloatField(default=0, help_text='Total Current (A)'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
22
dashboard/migrations/0004_mesin.py
Normal file
22
dashboard/migrations/0004_mesin.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Generated by Django 4.2.30 on 2026-09-04 15:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0003_remove_kwhreadings_active_power_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Mesin',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nama_mesin', models.CharField(max_length=100)),
|
||||
('keterangan', models.TextField(blank=True, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
18
dashboard/migrations/0005_mesin_token.py
Normal file
18
dashboard/migrations/0005_mesin_token.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.30 on 2026-09-08 16:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0004_mesin'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='mesin',
|
||||
name='token',
|
||||
field=models.CharField(blank=True, max_length=64, null=True, unique=True),
|
||||
),
|
||||
]
|
||||
28
dashboard/migrations/0006_area_mesin_area.py
Normal file
28
dashboard/migrations/0006_area_mesin_area.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 4.2.30 on 2026-09-09 14:09
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0005_mesin_token'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Area',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nama_area', models.CharField(max_length=100, unique=True)),
|
||||
('keterangan', models.TextField(blank=True, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='mesin',
|
||||
name='area',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='mesin_list', to='dashboard.area'),
|
||||
),
|
||||
]
|
||||
19
dashboard/migrations/0007_kwhreadings_mesin.py
Normal file
19
dashboard/migrations/0007_kwhreadings_mesin.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.30 on 2026-09-15 15:17
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0006_area_mesin_area'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='kwhreadings',
|
||||
name='mesin',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='readings', to='dashboard.mesin'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.2.30 on 2026-09-16 09:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0007_kwhreadings_mesin'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddIndex(
|
||||
model_name='kwhreadings',
|
||||
index=models.Index(fields=['mesin', '-id'], name='dashboard_k_mesin_i_2c713b_idx'),
|
||||
),
|
||||
]
|
||||
18
dashboard/migrations/0009_mesin_status.py
Normal file
18
dashboard/migrations/0009_mesin_status.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.30 on 2026-09-28 10:20
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dashboard', '0008_kwhreadings_dashboard_k_mesin_i_2c713b_idx'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='mesin',
|
||||
name='status',
|
||||
field=models.CharField(blank=True, default='normal', max_length=20, null=True),
|
||||
),
|
||||
]
|
||||
0
dashboard/migrations/__init__.py
Normal file
0
dashboard/migrations/__init__.py
Normal file
Reference in New Issue
Block a user