cmsmanage/doorcontrol/migrations/0001_initial.py
Adam Goldsmith a6c531c22f Add doorcontrol app for managing HID door controllers
Just read-only access to the event log dump for now
2023-04-03 16:15:20 -04:00

100 lines
3.9 KiB
Python

# Generated by Django 4.1.3 on 2023-01-25 02:18
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="HIDEvent",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("door_name", models.CharField(db_column="doorName", max_length=64)),
("timestamp", models.DateTimeField()),
(
"event_type",
models.IntegerField(
choices=[
(1022, "Denied Access: Card Not Found"),
(1023, "Denied Access Access: PIN Not Found"),
(2020, "Granted Access"),
(2021, "Granted Access: Extended Time"),
(2024, "Denied Access: Schedule"),
(2029, "Denied Access: Wrong PIN"),
(2036, "Denied Access: Card Expired"),
(2042, "Denied Access: PIN Lockout"),
(2043, "Denied Access: Unassigned Card"),
(2044, "Denied Access: Unassigned Access PIN"),
(2046, "Denied Access: PIN Expired"),
(4034, "Alarm Acknowledged"),
(4035, "Door Locked: Scheduled"),
(4036, "Door Unlocked: Scheduled"),
(4041, "Door Forced Alarm"),
(4042, "Door Held Alarm"),
(4043, "Tamper Switch Alarm"),
(4044, "AC Failure"),
(4045, "Battery Failure"),
(4051, "REX Switch Alarm"),
(7020, "Time Set To"),
(12031, "Granted Access: Manual"),
(12032, "Door Unlocked"),
(12033, "Door Locked"),
],
db_column="eventType",
),
),
("reader_address", models.IntegerField(db_column="readerAddress")),
(
"cardholder_id",
models.IntegerField(
blank=True, db_column="cardholderID", null=True
),
),
(
"command_status",
models.BooleanField(
blank=True, db_column="commandStatus", null=True
),
),
("forename", models.TextField(blank=True, null=True)),
("surname", models.TextField(blank=True, null=True)),
(
"io_state",
models.BooleanField(blank=True, db_column="ioState", null=True),
),
(
"new_time",
models.DateTimeField(blank=True, db_column="newTime", null=True),
),
(
"old_time",
models.DateTimeField(blank=True, db_column="oldTime", null=True),
),
(
"raw_card_number",
models.CharField(
blank=True, db_column="rawCardNumber", max_length=8, null=True
),
),
],
options={
"db_table": "hidevent",
"ordering": ("-timestamp",),
"managed": False,
},
),
]