|
|
|
|
|
CREATE SCHEMA IF NOT EXISTS "spider__bike_1"; |
|
|
|
|
|
|
|
|
CREATE TABLE "spider__bike_1"."station" ( |
|
|
"id" BIGINT NOT NULL, |
|
|
"name" TEXT, |
|
|
"lat" NUMERIC, |
|
|
"long" NUMERIC, |
|
|
"dock_count" BIGINT, |
|
|
"city" TEXT, |
|
|
"installation_date" TEXT, |
|
|
CONSTRAINT "station_pkey" PRIMARY KEY ("id") |
|
|
); |
|
|
|
|
|
|
|
|
CREATE TABLE "spider__bike_1"."status" ( |
|
|
"station_id" BIGINT, |
|
|
"bikes_available" BIGINT, |
|
|
"docks_available" BIGINT, |
|
|
"time" TEXT |
|
|
); |
|
|
|
|
|
|
|
|
CREATE TABLE "spider__bike_1"."trip" ( |
|
|
"id" BIGINT NOT NULL, |
|
|
"duration" BIGINT, |
|
|
"start_date" TEXT, |
|
|
"start_station_name" TEXT, |
|
|
"start_station_id" BIGINT, |
|
|
"end_date" TEXT, |
|
|
"end_station_name" TEXT, |
|
|
"end_station_id" BIGINT, |
|
|
"bike_id" BIGINT, |
|
|
"subscription_type" TEXT, |
|
|
"zip_code" BIGINT, |
|
|
CONSTRAINT "trip_pkey" PRIMARY KEY ("id") |
|
|
); |
|
|
|
|
|
|
|
|
CREATE TABLE "spider__bike_1"."weather" ( |
|
|
"date" TEXT, |
|
|
"max_temperature_f" BIGINT, |
|
|
"mean_temperature_f" BIGINT, |
|
|
"min_temperature_f" BIGINT, |
|
|
"max_dew_point_f" BIGINT, |
|
|
"mean_dew_point_f" BIGINT, |
|
|
"min_dew_point_f" BIGINT, |
|
|
"max_humidity" BIGINT, |
|
|
"mean_humidity" BIGINT, |
|
|
"min_humidity" BIGINT, |
|
|
"max_sea_level_pressure_inches" NUMERIC, |
|
|
"mean_sea_level_pressure_inches" NUMERIC, |
|
|
"min_sea_level_pressure_inches" NUMERIC, |
|
|
"max_visibility_miles" BIGINT, |
|
|
"mean_visibility_miles" BIGINT, |
|
|
"min_visibility_miles" BIGINT, |
|
|
"max_wind_Speed_mph" BIGINT, |
|
|
"mean_wind_speed_mph" BIGINT, |
|
|
"max_gust_speed_mph" BIGINT, |
|
|
"precipitation_inches" BIGINT, |
|
|
"cloud_cover" BIGINT, |
|
|
"events" TEXT, |
|
|
"wind_dir_degrees" BIGINT, |
|
|
"zip_code" BIGINT |
|
|
); |
|
|
|
|
|
|
|
|
ALTER TABLE "spider__bike_1"."status" ADD CONSTRAINT "fk_status_0" FOREIGN KEY ("station_id") REFERENCES "spider__bike_1"."station" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION; |
|
|
|