Skip to content

create and test arcgis pro attribute rules for uic db

Notifications You must be signed in to change notification settings

MichaelAGRC/uic-attribute-rules

 
 

Repository files navigation

UIC Attribute Rules

Setup

  1. create local database from sql management studio named UIC

  2. enable as enterprise gdb via pro

    import arcpy
    arcpy.management.EnableEnterpriseGeodatabase(r'...\uic-attribute-rules\pro-project\localhost.sde', r'C:\Program Files\ESRI\License10.6\sysgen\keycodes')

    If you receive errors, you may need to execute the following sql

    ALTER DATABASE UIC
    SET ALLOW_SNAPSHOT_ISOLATION ON
    
    ALTER DATABASE UIC
    SET READ_COMMITTED_SNAPSHOT ON
  3. import the XML Workspace for the existing UIC database

    arcpy.management.ImportXMLWorkspaceDocument(r'...\uic-attribute-rules\pro-project\localhost.sde', r'...\uic-attribute-rules\data\UIC_STAGING.XML', 'SCHEMA_ONLY', None)
  4. Create a python conda workspace for the project

    conda create --clone arcgispro-py3 --name uic
  5. Activate the environment

    activate uic
  6. install the development requirements

    pip install -r requirements.dev.txt

Installation

Database Migrations

Update Enterprise GDB

  1. Update to >= 10.7.1

Remove feature dataset

  1. Import the individual feature classes contained within the feature datasets
  2. Import everything outside the feature dataset

Add reference data

  1. County boundaries
  2. Municipal boundaries
  3. Zip code boundaries

python migrations

  1. add localhost.sde, stage.sde, and prod.sde to the pro-project
  2. run migration code
    • python migrations.py migrate --env=local, dev, prod

This is a doc opt cli, so check the help for the tool

What happens
  1. removes unused tables
  2. unversions tables
  3. disables editor tracking
  4. adds and removes table fields
  5. removes unused domains
  6. moves fields from one table to another
  7. creates well contingency
  8. adds editor tracking
  9. versions tables

Attribute Rules

  1. add localhost.sde, stage.sde, and prod.sde to the pro-project
  2. Install attribute rules
    • python ar.py update --env=local, dev, prod
    • You can specify --rule= to only update a tables worth of rules

This is a doc opt cli, so check the help for the tool.

Releasing

  1. Bump ar.py VERSION string
  2. Bump ruletypes.py Constraint.error_number to match in the integer form
    • Bump before you run since it adds a record to the Version_Information table
  3. Bump migration.py if it changed.
    • Bump before you run since it adds a record to the Version_Information table

About

create and test arcgis pro attribute rules for uic db

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 73.3%
  • JavaScript 26.7%