us_geo 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/db/migrate/20230414000700_add_short_name_to_core_based_statistical_areas.rb +3 -1
- data/db/migrate/20230414000750_add_short_name_to_combined_statistical_areas.rb +3 -1
- data/db/migrate/20230417000200_add_unique_name_index_to_county_subdivisions.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 711c99585d65af3e17634a5ae2a3d18927e2b110561b0514a045e8bcd5d1374f
|
4
|
+
data.tar.gz: b44bd355b23abf0d66dfad0a0f128877fe52243324a94e6be9c55064ee2a525d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70a6b4d77c0ce0493d36d7459f62cf54a34d7f1e19cecbccc30184329134177092d7bb77eda0110c7c939d0002f3d932360ef7d3aa7f5b9ae89f9d99d932d92c
|
7
|
+
data.tar.gz: '09443a88e94d09406a9630d2c1290c4641e0111e9f18b4239dc25d0c4667b5759cea11bc9c9036497c082ee78d9bc31e7c091276538a3b93e18812488af19df8'
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 2.0.2
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- Migrations that update existing data are now compatible with Rails versions prior to 7.0.
|
12
|
+
|
7
13
|
## 2.0.1
|
8
14
|
|
9
15
|
### Added
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.2
|
@@ -6,10 +6,12 @@ class AddShortNameToCoreBasedStatisticalAreas < ActiveRecord::Migration[5.0]
|
|
6
6
|
|
7
7
|
add_column :us_geo_core_based_statistical_areas, :short_name, :string, null: true
|
8
8
|
|
9
|
+
update_sql = "UPDATE us_geo_core_based_statistical_areas SET short_name = ? WHERE geoid = ?"
|
10
|
+
|
9
11
|
select_all("SELECT geoid, name FROM us_geo_core_based_statistical_areas").each do |row|
|
10
12
|
city, state = row["name"].split(", ", 2)
|
11
13
|
short_name = "#{city.split("-").first}, #{state.split("-").first}"
|
12
|
-
update(
|
14
|
+
update ActiveRecord::Base.sanitize_sql([update_sql, short_name, row["geoid"]])
|
13
15
|
end
|
14
16
|
|
15
17
|
change_column_null :us_geo_core_based_statistical_areas, :short_name, false
|
@@ -6,10 +6,12 @@ class AddShortNameToCombinedStatisticalAreas < ActiveRecord::Migration[5.0]
|
|
6
6
|
|
7
7
|
add_column :us_geo_combined_statistical_areas, :short_name, :string, null: true
|
8
8
|
|
9
|
+
update_sql = "UPDATE us_geo_combined_statistical_areas SET short_name = ? WHERE geoid = ?"
|
10
|
+
|
9
11
|
select_all("SELECT geoid, name FROM us_geo_combined_statistical_areas").each do |row|
|
10
12
|
city, state = row["name"].split(", ", 2)
|
11
13
|
short_name = "#{city.split("-").first}, #{state.split("-").first}"
|
12
|
-
update(
|
14
|
+
update ActiveRecord::Base.sanitize_sql([update_sql, short_name, row["geoid"]])
|
13
15
|
end
|
14
16
|
|
15
17
|
change_column_null :us_geo_combined_statistical_areas, :short_name, false
|
@@ -13,8 +13,10 @@ class AddUniqueNameIndexToCountySubdivisions < ActiveRecord::Migration[5.0]
|
|
13
13
|
AND t1.name = t2.name
|
14
14
|
SQL
|
15
15
|
|
16
|
+
update_sql = "UPDATE us_geo_county_subdivisions SET name = ? WHERE geoid = ?"
|
17
|
+
|
16
18
|
select_all(duplicates_sql).each do |row|
|
17
|
-
update(
|
19
|
+
update ActiveRecord::Base.sanitize_sql([update_sql, "#{row["name"]} (duplicate)", row["geoid"]])
|
18
20
|
end
|
19
21
|
|
20
22
|
add_index :us_geo_county_subdivisions, [:name, :county_geoid], unique: true, name: "index_us_geo_county_subdivisions_on_unique_name"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: us_geo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|