Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weather-model
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
weather-model
Commits
ff582435
Commit
ff582435
authored
May 21, 2017
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix aqi_live
parent
7253acba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
29 deletions
+9
-29
4_create_realtime_aqi.rb
db/migrate/4_create_realtime_aqi.rb
+0
-20
aqi.rb
lib/weather-model/source_schemas/aqi.rb
+9
-9
No files found.
db/migrate/4_create_realtime_aqi.rb
deleted
100644 → 0
View file @
7253acba
class
CreateRealtimeAqi
<
ActiveRecord
::
Migration
[
5.0
]
def
up
create_table
:realtime_aqi
do
|
t
|
t
.
datetime
:datetime
t
.
integer
:aqi
t
.
string
:level
t
.
string
:pripoll
t
.
string
:content
t
.
string
:measure
t
.
timestamps
end
add_index
:realtime_aqi
,
:datetime
end
def
down
drop_table
:realtime_aqi
end
end
lib/weather-model/source_schemas/aqi.rb
View file @
ff582435
...
@@ -59,27 +59,27 @@ module WeatherModel
...
@@ -59,27 +59,27 @@ module WeatherModel
aqi: :integer
,
aqi: :integer
,
area: :string
,
area: :string
,
co: :float
,
co: :float
,
co_24: :float
,
co_24
h
: :float
,
no2: :float
,
no2: :float
,
no2_24: :float
,
no2_24
h
: :float
,
o3: :float
,
o3: :float
,
o3_24: :float
,
o3_24
h
: :float
,
o3_8h: :float
,
o3_8h: :float
,
o3_8h_24: :float
,
o3_8h_24
h
: :float
,
pm10: :float
,
pm10: :float
,
pm10_24: :float
,
pm10_24
h
: :float
,
pm2_5: :float
,
pm2_5: :float
,
pm2_5_24: :float
,
pm2_5_24
h
: :float
,
position_name: :string
,
position_name: :string
,
primary_pollutant: :string
,
primary_pollutant: :string
,
quality: :string
,
quality: :string
,
so2: :float
,
so2: :float
,
so2_24h: :float
,
so2_24h: :float
,
station_code: :string
,
station_code: :string
,
time_point: :dateime
,
time_point: :date
t
ime
,
},
},
options:
{
options:
{
index:
%i[area
,
time_point]
,
index:
%i[area time_point]
,
expire:
2
*
24
*
60
*
60
,
expire:
2
*
24
*
60
*
60
,
unique:
nil
,
unique:
nil
,
belongs_to:
nil
,
belongs_to:
nil
,
...
@@ -108,7 +108,7 @@ module WeatherModel
...
@@ -108,7 +108,7 @@ module WeatherModel
"so2"
=>
10
,
"so2"
=>
10
,
"so2_24h"
=>
13
,
"so2_24h"
=>
13
,
"station_code"
=>
"1885A"
,
"station_code"
=>
"1885A"
,
"time_point"
=>
"2017-05-21T16:00:00Z"
,
"time_point"
=>
Time
.
parse
(
"2017-05-21 16:00:00"
)
,
},
},
}
}
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment