File size: 1,917 Bytes
9a9f901 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
-- Schema: spider__bike_1
CREATE SCHEMA IF NOT EXISTS "spider__bike_1";
-- Table: station
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")
);
-- Table: status
CREATE TABLE "spider__bike_1"."status" (
"station_id" BIGINT,
"bikes_available" BIGINT,
"docks_available" BIGINT,
"time" TEXT
);
-- Table: trip
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")
);
-- Table: weather
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
);
-- Foreign Keys
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;
|