Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sf_districts table and seed with SF district info #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions db/migrate/20190606025731_create_sf_districts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateSfDistricts < ActiveRecord::Migration[5.2]
def change
create_table :sf_districts do |t|
t.string :district_name
t.string :supervisor_name
t.geometry :geom
end

# Seed the SF districts table:
ActiveRecord::Base.connection.execute(IO.read(Rails.root.join('db', 'sql-files', 'sf_districts.sql')))
end
end
8 changes: 7 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_04_11_041012) do
ActiveRecord::Schema.define(version: 2019_06_06_025731) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -99,6 +99,12 @@
t.index ["service_request_id"], name: "index_sf311_cases_on_service_request_id", unique: true
end

create_table "sf_districts", force: :cascade do |t|
t.string "district_name"
t.string "supervisor_name"
t.geometry "geom", limit: {:srid=>0, :type=>"geometry"}
end

create_table "sf_mta_ridership_counts", force: :cascade do |t|
t.string "counter_location"
t.string "days"
Expand Down
19 changes: 19 additions & 0 deletions db/sql-files/sf_districts.sql

Large diffs are not rendered by default.