Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Table ip_bans:
- ip: INET (primary)
- infractions: smallint
- expires_at: timestamp without time zone (30 days after a ban, refreshed with each new infraction, after 3 infractions perman ban on the account)
- Table users: (DONE)
- uid: character varying[64] (primary)
- fcm_device_token: text[]
- last_app_language: character[2] (default: 'en')
- first_name: text
- family_name: text
- gender: char
- birthdate: date
- country_code: character[2]
- rating: real (default: -1)
- blocked_users: character varying[64] []
- newsletter: boolean (default: false)
- banned: boolean (default: false)
- creationtimestamp: timestamp without time zone
- restricted_until: timestamp without time zone (curr time + 20 secs after a critical action)
- Table messages_quick_rides: (DONE)
- id: bigserial (primary)
- matched_ride_id: bigint (required, unique id identifying the matched ride - LINKED to matched_quick_rides table as foreign key, on DELETE DROP)
- sender: character varying[64] (not required, foreign key user table, on DELETE SET NULL)
- content: text
- creationtimestamp: timestamp without time zone
- Table ratings:
- id: bigserial (primary)
- status: smallint (0= pending, 1= rating given, 2= dismissed) (default: 0)
- recipient: character varying[64] (required, foreign key user table, on DELETE DROP)
- sender: character varying[64] (not required, foreign key user table, on DELETE SET NULL)
- rating: real (0.0 - 5.0), can be NULL
- ride_id: bigint (not required, unique id identifying the ride - LINKED to past_rides table id as foreign key, on DELETE SET NULL)
- creationtimestamp: timestamp without time zone (as soon as a ride moves to past rides)
- Table quick_rides: (DONE) (only one per user)
- id: bigserial (primary)
- status: smallint (0=active/searching, 1=idle/waiting, 2=match accepted, 3=ride finished, 4=aborted) (default: 0)
- matched_ride_id: bigint (not required, unique id identifying the matched ride - LINKED to matched_quick_rides table as foreign key, on DELETE SET NULL)
- previously_compared: bigint[]
- last_route_attempt: timestamp without time zone
- origin_name: text
- origin_osm_id: text
- origin_pos: postgis.geography (PostGIS)
- origin_post_code: text
- origin_city: text
- origin_county: text
- origin_state: text
- origin_country_code: character[2]
- destination_name: text
- destination_osm_id: text
- destination_pos: postgis.geography (PostGIS)
- destination_post_code: text
- destination_city: text
- destination_county: text
- destination_state: text
- destination_country_code: character[2]
- waypoints: postgis.geography[]
- geometry: text
- distance: integer (in Meter, fastest route for user)
- duration: integer (length of ride in seconds, fastest route for user)
- creator: character varying[64] (not required, foreign key user table, on DELETE SET NULL)
- search_radius: real (in km e.g. 0.5 km) (default: 2.0 km)
- creationtimestamp: timestamp without time zone
- Table matched_quick_rides: (DONE)
- id: bigserial (primary)
- status: smallint (0=active/routed, 1=in-progress, 2= finished, 3=aborted) (default: 0)
- riders: character varying[64] [] (stored in alphabetical order of who A and B is)
- riders_finished: character varying[64] []
- origin_name: text
- origin_osm_id: text
- origin_pos: postgis.geography (PostGIS)
- origin_post_code: text
- origin_city: text
- origin_county: text
- origin_state: text
- origin_country_code: character[2]
- destination_name: text
- destination_osm_id: text
- destination_pos: postgis.geography (PostGIS)
- destination_post_code: text
- destination_city: text
- destination_county: text
- destination_state: text
- destination_country_code: character[2]
- route_order: text (e.g. 'ABAB')
- polylines_data: postgis.geography[] (array of polylines according to route order, first is A-B, then B-C, then C-D)
- polylines_lengths: integer[] (length in Meter for each polyline in the same order as above)
- geometry: text
- distance: integer (total distance in Meter for joined ride)
- duration: integer (total length of ride in seconds, joined ride)
- creationtimestamp: timestamp without time zone
- Table messages_planned_rides:
- id: bigserial (primary)
- planned_ride_id: bigint (required, unique id identifying the target planned ride - LINKED to planned_rides table as foreign key, on DELETE DROP)
- sender: character varying[64] (not required, foreign key user table, on DELETE SET NULL)
- content: text
- creationtimestamp: timestamp without time zone
- Table planned_rides: (max 3 per user)
- id: bigserial (primary)
- status: smallint (0=active, 1=in-progress, 2= finished, 3=aborted) (default: 0)
- riders: character varying[64] []
- riders_finished: character varying[64] []
- date_time: timestamp without timezone
- origin_name: text
- origin_osm_id: text
- origin_pos: postgis.geography (PostGIS)
- origin_post_code: text
- origin_city: text
- origin_county: text
- origin_state: text
- origin_country_code: character[2]
- destination_name: text
- destination_osm_id: text
- destination_pos: postgis.geography (PostGIS)
- destination_post_code: text
- destination_city: text
- destination_county: text
- destination_state: text
- destination_country_code: character[2]
- waypoints: postgis.geography[]
- geometry: text
- distance: integer (in Meter, fastest route for creator)
- duration: integer (length of ride in seconds, fastest route for creator)
- creator: character varying[64] (not required, foreign key user table, on DELETE SET NULL)
- creationtimestamp: timestamp without time zone
- Table past_rides:
- id: bigserial (primary)
- riders: character varying[64] []
- date_time: timestamp without timezone
- origin_name: text
- origin_osm_id: text
- origin_pos: postgis.geography (PostGIS)
- origin_post_code: text
- origin_city: text
- origin_county: text
- origin_state: text
- origin_country_code: character[2]
- destination_name: text
- destination_osm_id: text
- destination_pos: postgis.geography (PostGIS)
- destination_post_code: text
- destination_city: text
- destination_county: text
- destination_state: text
- destination_country_code: character[2]
- geometry: text
- distance: integer (in Meter)
- duration: integer (length of ride in seconds)
- creator: character varying[64] (not required, foreign key user table, on DELETE DROP)
- creationtimestamp: timestamp without time zone
Add Comment
Please, Sign In to add comment