-- -------------------------------------------------------------
-- TablePlus 2.12(282)
--
-- https://tableplus.com/
--
-- Database: savvy
-- Generation Time: 2020-01-11 13:31:52.8090
-- -------------------------------------------------------------


-- This script only contains the table creation statements and does not fully represent the table in the database. It's still missing: indices, triggers. Do not use it as a backup.

-- Sequence and defined type
CREATE SEQUENCE IF NOT EXISTS geofence_area_id_seq;

-- Table Definition
CREATE TABLE "public"."geofence_area" (
    "id" int4 NOT NULL DEFAULT nextval('geofence_area_id_seq'::regclass),
    "name" varchar(100),
    "area" varchar(100),
    "city_id" int4,
    "country" varchar(2),
    "latitude" float8,
    "longitude" float8,
    "location" geography(Point, 4326),
    "type" varchar(15),
    "boundaries" json,
    PRIMARY KEY ("id")
);

-- This script only contains the table creation statements and does not fully represent the table in the database. It's still missing: indices, triggers. Do not use it as a backup.

-- Sequence and defined type
CREATE SEQUENCE IF NOT EXISTS geofence_area_city_id_seq;

-- Table Definition
CREATE TABLE "public"."geofence_area_city" (
    "id" int4 NOT NULL DEFAULT nextval('geofence_area_city_id_seq'::regclass),
    "city" varchar(100),
    "country" varchar(2),
    "latitude" float8,
    "longitude" float8,
    "location" geography(Point, 4326),
    "radius" int4,
    PRIMARY KEY ("id")
);

-- This script only contains the table creation statements and does not fully represent the table in the database. It's still missing: indices, triggers. Do not use it as a backup.

-- Sequence and defined type
CREATE SEQUENCE IF NOT EXISTS geofence_area_country_id_seq;

-- Table Definition
CREATE TABLE "public"."geofence_area_country" (
    "id" int4 NOT NULL DEFAULT nextval('geofence_area_country_id_seq'::regclass),
    "country" varchar(2),
    "latitude" float8,
    "longitude" float8,
    "location" geography(Point, 4326),
    "radius" int4,
    PRIMARY KEY ("id")
);


