from django.db import models

# Create your models here.
class AllDevCmdDefineAndVersion(models.Model):
    id = models.AutoField(primary_key=True)  # Field name made lowercase.
    cmd_name = models.TextField()  # Field name made lowercase.
    cmd_type = models.TextField()  # Field name made lowercase.
    fieldindex = models.IntegerField()  # Field name made lowercase.
    fieldname = models.TextField()  # Field name made lowercase.
    fieldsize = models.IntegerField()  # Field name made lowercase.
    value = models.TextField()
    minvalue = models.TextField()  # Field name made lowercase.
    maxvalue = models.TextField()  # Field name made lowercase.
    datatype = models.IntegerField()  # Field name made lowercase.
    operation_in = models.IntegerField()
    operation_in_num = models.IntegerField()
    operation_out = models.IntegerField()
    operation_out_num = models.IntegerField()
    operabo_in = models.IntegerField()  # Field name made lowercase.
    operabo_out = models.IntegerField()  # Field name made lowercase.
    lua_script_in = models.TextField()  # Field name made lowercase.
    lua_script_out = models.TextField()  # Field name made lowercase.
    version = models.TextField()

    class Meta:
        db_table = 'AllDevCmdDefineAndVersion'


class AllProtocolDefinAndVersion(models.Model):
    id = models.AutoField(primary_key=True)  # Field name made lowercase.
    protocol_name = models.TextField()  # Field name made lowercase.
    cmd_name = models.TextField()  # Field name made lowercase.
    cmd_type = models.TextField()  # Field name made lowercase.
    encode = models.TextField()  # Field name made lowercase.
    timing_cmd_cycle_period = models.IntegerField()  # Field name made lowercase.
    cmd_explain = models.TextField()  # Field name made lowercase.
    version = models.TextField()

    class Meta:
        db_table = 'AllProtocolDefinAndVersion'


class CurrentDevVersion(models.Model):
    id = models.AutoField(primary_key=True)  # Field name made lowercase.
    protocol_name = models.TextField()  # Field name made lowercase.
    version = models.TextField()

    class Meta:
        db_table = 'CurrentDevVersion'


class AllProtocolChangeLog(models.Model):
    id = models.AutoField(primary_key=True)  # Field name made lowercase.
    protocol_name = models.TextField()  # Field name made lowercase.
    log = models.TextField()

    class Meta:
        db_table = 'AllProtocolChangeLog'


class Test(models.Model):

    id = models.AutoField(primary_key=True)
    json = models.TextField()

    class Meta:
        db_table = 'Test'

