from django.db import models
from django.contrib.gis.db import models

import django.db.models.options as options
options.DEFAULT_NAMES = options.DEFAULT_NAMES + ('in_db',)

class ArchivedPermits(models.Model):
    id = models.TextField(blank=True, null=True)
    entry_date = models.DateField(blank=True, null=True)
    issue_date = models.DateField(blank=True, null=True)
    permit_number = models.TextField(blank=True, null=True)
    jurisdiction = models.TextField(blank=True, null=True)
    applic_addr = models.TextField(blank=True, null=True)
    applic_city = models.TextField(blank=True, null=True)
    applic_fax = models.TextField(blank=True, null=True)
    applic_title = models.TextField(blank=True, null=True)
    location = models.TextField(blank=True, null=True)
    street = models.TextField(blank=True, null=True)
    type = models.TextField(blank=True, null=True)
    comments = models.TextField(blank=True, null=True)
    expiration_date = models.DateField(blank=True, null=True)
    final_date = models.DateField(blank=True, null=True)
    permit_effect_date = models.DateField(blank=True, null=True)
    effect_date = models.DateField(blank=True, null=True)
    bond_number = models.TextField(blank=True, null=True)
    bond_expiration_date = models.DateField(blank=True, null=True)
    daily_posting_date = models.DateField(blank=True, null=True)
    commodity = models.TextField(blank=True, null=True)
    duplicate = models.TextField(blank=True, null=True)
    trip = models.TextField(blank=True, null=True)
    st_phrase = models.TextField(blank=True, null=True)
    excl_road_ole = models.TextField(blank=True, null=True)
    encr_brk_crb = models.TextField(blank=True, null=True)
    encr_instl_strm = models.TextField(blank=True, null=True)
    encr_side_wlk = models.TextField(blank=True, null=True)
    encr_side_wlk_desc = models.TextField(blank=True, null=True)
    encr_curb_desc = models.TextField(blank=True, null=True)
    encr_drwy = models.TextField(blank=True, null=True)
    encr_drwy_ft = models.TextField(blank=True, null=True)
    encr_drwy_typ = models.TextField(blank=True, null=True)
    encr_other = models.TextField(blank=True, null=True)
    encr_other_desc = models.TextField(blank=True, null=True)
    encr_grvl = models.TextField(blank=True, null=True)
    encr_grvl_ft = models.TextField(blank=True, null=True)
    encr_grvl_type = models.TextField(blank=True, null=True)
    encr_grvl_rck = models.TextField(blank=True, null=True)
    encr_grvl_grvl = models.TextField(blank=True, null=True)
    encr_grvl_asphlt = models.TextField(blank=True, null=True)
    encr_grvl_asphlt_type = models.TextField(blank=True, null=True)
    encr_pipe = models.TextField(blank=True, null=True)
    encr_pipe_ft = models.TextField(blank=True, null=True)
    encr_pipe_inch = models.TextField(blank=True, null=True)
    encr_gutter = models.TextField(blank=True, null=True)
    encr_gutter_ft = models.TextField(blank=True, null=True)
    encr_park = models.TextField(blank=True, null=True)
    encr_park_desc = models.TextField(blank=True, null=True)
    encr_other_2 = models.TextField(blank=True, null=True)
    encr_other_2_desc = models.TextField(blank=True, null=True)
    util_pole = models.TextField(blank=True, null=True)
    util_pole_desc = models.TextField(blank=True, null=True)
    util_cable = models.TextField(blank=True, null=True)
    util_cable_desc = models.TextField(blank=True, null=True)
    util_pipe = models.TextField(blank=True, null=True)
    util_pipe_desc = models.TextField(blank=True, null=True)
    util_misc = models.TextField(blank=True, null=True)
    util_sign = models.TextField(blank=True, null=True)
    util_cnty_main = models.TextField(blank=True, null=True)
    util_ins_req = models.TextField(blank=True, null=True)
    util_bond_req = models.TextField(blank=True, null=True)
    util_depth = models.TextField(blank=True, null=True)
    util_cut = models.TextField(blank=True, null=True)
    util_bore = models.TextField(blank=True, null=True)
    util_tunnel = models.TextField(blank=True, null=True)
    util_desc = models.TextField(blank=True, null=True)
    st_eqp_load_length = models.TextField(blank=True, null=True)
    st_eqp_width = models.TextField(blank=True, null=True)
    st_eqp_height = models.TextField(blank=True, null=True)
    st_eqp_overall_length = models.TextField(blank=True, null=True)
    st_eqp_rear_overhang = models.TextField(blank=True, null=True)
    st_eqp_front_overhang = models.TextField(blank=True, null=True)
    st_eqp_gross_weight = models.TextField(blank=True, null=True)
    st_eqp_table = models.TextField(blank=True, null=True)
    st_eqp_table_note = models.TextField(blank=True, null=True)
    st_eqp_pilot_two_lane = models.TextField(blank=True, null=True)
    st_eqp_pilot_four_lane = models.TextField(blank=True, null=True)
    permit_count = models.TextField(blank=True, null=True)
    pkey = models.AutoField(primary_key=True)

    class Meta:
        managed = False
        db_table = 'archived_permits'
        in_db = 'multnomah_county_permits'


class CurrentPermits(models.Model):
    permit_id = models.TextField(primary_key=True)
    entry_date = models.DateField(blank=True, null=True)
    issue_date = models.DateField(blank=True, null=True)
    permit_category = models.TextField(blank=True, null=True)
    type = models.TextField(blank=True, null=True)
    district = models.TextField(blank=True, null=True)
    city_state = models.TextField(blank=True, null=True)
    location = models.TextField(blank=True, null=True)
    cross_street = models.TextField(blank=True, null=True)
    street_number = models.TextField(blank=True, null=True)
    direction = models.TextField(blank=True, null=True)
    street = models.TextField(blank=True, null=True)
    street_type = models.TextField(blank=True, null=True)
    city = models.TextField(blank=True, null=True)
    state = models.TextField(blank=True, null=True)
    zip_code = models.TextField(blank=True, null=True)
    comments = models.TextField(blank=True, null=True)
    expiration_date = models.DateField(blank=True, null=True)
    final_date = models.DateField(blank=True, null=True)
    effect_date = models.DateField(blank=True, null=True)
    lat_lng = models.TextField(blank=True, null=True)
    longitude = models.FloatField(blank=True, null=True)
    latitude = models.FloatField(blank=True, null=True)
    geom_point = models.GeometryField(blank=True, null=True, srid=4326)

    class Meta:
        managed = False
        db_table = 'current_permits'
        in_db = 'multnomah_county_permits'
