Skip to content

Commit

Permalink
got it working
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbun committed May 24, 2023
1 parent ff4189d commit b655b6b
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions conf/evolutions/default/188.sql → conf/evolutions/default/187.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --- !Ups
# --- do we need more lat/lng cords?
--- do we need more lat/lng cords?
CREATE TABLE config (
open_status TEXT NOT NULL,
mapathon_event_link TEXT NOT NULL,
Expand All @@ -10,14 +10,14 @@ CREATE TABLE config (
northeast_boundary_lat DOUBLE PRECISION NOT NULL,
northeast_boundary_lng DOUBLE PRECISION NOT NULL,
attribute_center_lat DOUBLE PRECISION NOT NULL,
attribute-center-lng DOUBLE PRECISION NOT NULL,
attribute-zoom DOUBLE PRECISION NOT NULL,
attribute-lat1 DOUBLE PRECISION NOT NULL,
attribute-lng1 DOUBLE PRECISION NOT NULL,
attribute-lat2 DOUBLE PRECISION NOT NULL,
attribute-lng2 DOUBLE PRECISION NOT NULL,
street-center-lat DOUBLE PRECISION NOT NULL,
street-center-lng DOUBLE PRECISION NOT NULL,
attribute_center_lng DOUBLE PRECISION NOT NULL,
attribute_zoom DOUBLE PRECISION NOT NULL,
attribute_lat1 DOUBLE PRECISION NOT NULL,
attribute_lng1 DOUBLE PRECISION NOT NULL,
attribute_lat2 DOUBLE PRECISION NOT NULL,
attribute_lng2 DOUBLE PRECISION NOT NULL,
street_center_lat DOUBLE PRECISION NOT NULL,
street_center_lng DOUBLE PRECISION NOT NULL,
street_zoom DOUBLE PRECISION NOT NULL,
street_lat1 DOUBLE PRECISION NOT NULL,
street_lng1 DOUBLE PRECISION NOT NULL,
Expand All @@ -37,9 +37,8 @@ CREATE TABLE config (

);

# Insert one row into the database, choosing the correct city based on the db name.
INSERT INTO config VALUES ('partially', 'NOTE: There is nothing here', 47.615, -122.332, 47.400, -122.664, 47.850, -122.000,
-122.300, 15.5, 47.615, -122.307, 47.623, -122.293, 47.618, -122.299, 16.0, 47.611,
47.619, -122.300, 15.5, 47.615, -122.307, 47.623, -122.293, 47.618, -122.299, 16.0, 47.611,
-122.309, 47.625, -122.289, 47.616, -122.296, 13.0, 47.600, -122.320, 47.636, -122.275,
11.75, 27645, 3, '[
"tactile warning"
Expand All @@ -53,7 +52,7 @@ INSERT INTO config VALUES ('partially', 'NOTE: There is nothing here', 47.615, -
"painted sidewalk"
"pedestrian arcade"
"too close to traffic"]'
) WHERE current_database() = 'sidewalk-seattle';
);

# ---!Downs
# --- !Downs
DROP TABLE config;

4 comments on commit b655b6b

@dylanbun
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@misaugstad do you mind confirming if there are anymore columns that should be added? Also how should the mapathon_event_link column be handled as in the config file I found nothing in that field. Thanks!

@misaugstad
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notes:

  1. I don't think any columns are missing!
  2. The mapathon_event_link column should be nullable, and you should fill it in with null values for every city!
  3. I'd move the last four columns (default_map_zoom, tutorial_street_edge_id, update_offset_hours, and excluded_tags) right after northeast_boundary_lng instead of being at the end.
  4. For everything from attribute_center_lat through region_lng2, those are for the API page, so can you prepend them each with api_? So it would be api_attribute_center_lat, etc.

@dylanbun
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@misaugstad Makes sense! For 2, to make a column nullable did you want NULL or NULLABLE?

@misaugstad
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not totally sure what you mean, but what I'm imagining is that the you just remove the NOT NULL constraint from that column when creating the table, and when inserting you insert NULL

Please sign in to comment.