parking rule table structure

Contents

parking rule table structure#

The parking rule table lists the parking rules for each parking, the prioirty of applying this rule (if multiple rules exist), and the maximum duration for the application of that rule

Table Structure#

Field

Type

NULL allowed

Default Value

Foreign key

Description

parking_rule*

INTEGER

NO

The parking rule identifier

parking

INTEGER

NO

Parking(parking)

The parking facility identifier (Foreign key reference to the parking table)

rule_type

INTEGER

NO

Parking rule type Values at rule_type.

rule_priority

INTEGER

NO

Priority for applying this parking rule

min_cost

REAL

YES

0

Minimum cost associated with this parking rule ($)

min_duration

REAL

YES

0

Minimum duration of stay of vehicles under this parking rule (seconds)

max_duration

REAL

YES

86400

Maximum duration of stay of vehicles under this parking rule (seconds)

(* - Primary key)

The SQL statement for table and index creation is below.

create TABLE IF NOT EXISTS Parking_Rule (
    parking_rule      INTEGER NOT NULL PRIMARY KEY,
    parking           INTEGER NOT NULL,
    rule_type         INTEGER NOT NULL,
    rule_priority     INTEGER NOT NULL,
    min_cost          REAL DEFAULT 0,
    min_duration      REAL DEFAULT 0,
    max_duration      REAL DEFAULT 86400,
    CONSTRAINT "parking_fk" FOREIGN KEY("parking") REFERENCES "Parking"("parking") DEFERRABLE INITIALLY DEFERRED
);

Enums#

The following enums are used in this table.

rule_type#

Enum Values Description#

Value

Name

Description

0

Free

1

Flat

2

Minute

3

Hourly

4

Daily

5

Monthly

6

Yearly