D. Berge
a55d2cc6fc
Update database templates to v0.4.5
2024-05-01 10:40:04 +02:00
D. Berge
d53e6060a4
Update database templates to v0.4.2
2023-09-15 20:01:54 +02:00
D. Berge
c1b5196134
Update database templates to v0.3.12.
...
Incorporates fix for bug #261 .
2023-09-09 20:45:11 +02:00
D. Berge
105fee0623
Update database schema template.
...
* midnight_shots uses final_shots rather than raw_shots
* log_midnight_shots removes stale midnight events
2022-05-15 13:28:15 +02:00
D. Berge
fdb5e0cbab
Update database templates to v0.3.12.
...
* Add midnight_shots view
* Add log_midnight_shots() procedure
2022-05-13 18:55:43 +02:00
D. Berge
1b925502bc
Update database templates to v0.3.11.
...
* Redefine augment_event_data()
2022-05-12 21:59:38 +02:00
D. Berge
1992efe914
Update database templates to v0.3.9.
...
* Add replace_placeholders()
* Add scan_placeholders() procedure
2022-05-12 21:47:38 +02:00
D. Berge
1da02738b0
Update database templates to v0.3.8.
...
* Add event_position()
* Add event_meta()
2022-05-12 21:40:23 +02:00
D. Berge
a2bd614b17
Update database templates.
...
* Optimise public.geometry_from_tstamp()
* Remove index on public.real_time_inputs.meta->>'tstamp'
* Fix adjust_planner()
2022-05-10 21:57:53 +02:00
D. Berge
39690c991b
Update database templates.
...
* Add index on public.real_time_inputs.meta->>'tstamp'
* Add public.geometry_from_tstamp()
* Add augment_event_data()
2022-05-01 19:47:16 +02:00
D. Berge
d386b97e42
Database upgrade 16: fix event edits.
...
Fixes #198 .
2022-04-27 17:41:53 +02:00
D. Berge
da578d2e50
Fix project_summary view returning unwanted rows.
...
Fixes #197 .
2022-04-27 10:49:46 +02:00
D. Berge
0d1f2b207c
Apply changes from 38e4e705a4 to DB schema template
2022-03-16 21:29:53 +01:00
D. Berge
0727e7db69
Update database templates to schema v0.3.1
2022-03-15 14:17:28 +01:00
D. Berge
81d9ea19cc
Add adjust_planner() function to DB schema.
...
It updates the planned lines details according to production and current
time.
2021-06-19 12:18:28 +02:00
D. Berge
497d4d68f9
Call notify on changes to schema's info table
2021-06-19 12:17:26 +02:00
D. Berge
853deca3c3
Rename misnamed trigger
2021-06-19 12:16:37 +02:00
D. Berge
f314536daf
Change planned_lines trigger from statement to row.
...
Because a) it tells us what has changed and b) doesn't fire if we
didn't actually change anything.
2021-05-28 20:30:59 +02:00
D. Berge
de4aa52417
Make planned_lines primary key deferrable.
...
Helps when we need to renumber sequences.
2021-05-28 20:30:59 +02:00
D. Berge
3d70a460ac
Output raw and final lines metadata in summary views
2021-05-25 02:13:50 +02:00
D. Berge
4d97784829
Upgrade database project schema template.
...
Adds:
* label_in_sequence (_sequence integer, _label text):
Returns events containing the specified label.
* handle_final_line_events (_seq integer, _label text, _column text):
- If _label does not exist in the events for sequence _seq:
it adds a new _label label at the shotpoint obtained from
final_lines_summary[_column].
- If _label does exist (and hasn't been auto-added by this function
in a previous run), it will add information about it to the final
line's metadata.
* final_line_post_import (_seq integer):
Calls handle_final_line_events() on the given sequence to check
for FSP, FGSP, LGSP and LSP labels.
* events_seq_labels_single ():
Trigger function to ensure that labels that have the attribute
`model.multiple` set to `false` occur at most only once per
sequence. If a new instance is added to a sequence, the previous
instance is deleted.
* Trigger on events_seq_labels that calls events_seq_labels_single().
* Trigger on events_timed_labels that calls events_seq_labels_single().
2021-05-24 16:49:39 +02:00
D. Berge
53f71f7005
Set primary key on events_seq_labels in schema template
2021-05-23 22:27:00 +02:00
D. Berge
5de64e6b45
Add meta column to events view in schema template
2021-05-23 22:26:00 +02:00
D. Berge
6e7ba82ed3
Add planner elements to DB schema
2020-10-09 13:54:45 +02:00
D. Berge
739cf4b9ec
Add missing triggers in preplot, raw and final tables
2020-10-06 19:19:35 +02:00
D. Berge
afa34867f5
Modify functions accessing file_data to return jsonb.
...
Following schema change in 2d270cdef9 .
2020-10-04 05:13:17 +02:00
D. Berge
3de7d5d334
Re-export schema template.
...
No changes, it merely shuffles the position of raw_lines
in the export.
2020-10-04 04:07:50 +02:00
D. Berge
3c215e9973
Fix error with definition of missing_final_points view
2020-10-04 04:06:15 +02:00
D. Berge
362d9dc1a5
Re-export schema template.
...
No changes, it merely shuffles the position of raw_lines
in the export.
2020-10-04 03:37:20 +02:00
D. Berge
1249c976ef
Add views related to missing shots and outstanding production
2020-10-04 03:33:23 +02:00
D. Berge
2d270cdef9
Change file_data column type from JSON to JSONB
2020-10-04 01:22:42 +02:00
D. Berge
198d0072d4
Show sequence remarks + NTBP status on map.
...
Closes #50 .
2020-10-02 17:58:44 +02:00
D. Berge
11a5020004
Remove old QCs when importing final shots.
...
When final shots are inserted, updated or
deleted, the corresponding QC info (which
is always held in raw_shots.meta->'qc')
is deleted.
If applicable, it will be recreated on the
next QC run.
2020-10-02 17:30:42 +02:00
D. Berge
c12c2a3861
Update events view.
...
Searches for timed events geometry within
the event's own metadata.
2020-09-30 22:49:01 +02:00
D. Berge
21439fdd3e
Associate a position with timed events if possible.
...
When inserting or updating a timed event, a trigger
searches the real time events table for a position
close (within one minute) of the event time and
adds it to the event's metadata.
2020-09-30 22:45:50 +02:00
D. Berge
9470f41f4b
Fix lookup of timed event labels.
...
Fixes #44 .
2020-09-24 15:32:25 +02:00
D. Berge
4dc1c7df8e
Re-export schema template.
...
No changes to the actual schema.
2020-09-24 15:31:53 +02:00
D. Berge
80324130f9
Return event geometries as GeoJSON
2020-09-24 15:24:47 +02:00
D. Berge
a4ed7f7b62
Return all QC events, not just those with labels
2020-09-23 20:19:13 +02:00
D. Berge
33c23c1239
Return event labels directly from events view.
...
This speeds up the query by orders of magnitude.
2020-09-23 16:31:55 +02:00
D. Berge
94c3ed1584
Update schema.
...
* Report also schema in projects_summary
* Add notify triggers to events_timed, events_seq
2020-09-14 23:54:48 +02:00
D. Berge
c9b9a009af
Speed up the events view.
...
We do this with the help of some denormalisation
and a handy trigger.
Closes #35 .
2020-09-14 03:01:55 +02:00
D. Berge
b5b91d41c9
Reset event serial ids after re-import.
...
When the database is recreated, the sequences
used in the events_timed and events_seq tables
will be at their initial values, which will
almost certainly conflict with existing data
when it is imported via COPY.
With this commit, we set the current value for
those sequences to something usable.
Fixes #33 .
2020-09-14 01:36:40 +02:00
D. Berge
bda11cc22f
Add raw_shots_preplots view.
...
Used by the QC routines.
2020-09-10 20:50:08 +02:00
D. Berge
48f2931a13
Change type of info table value to JSONB
2020-09-10 20:49:39 +02:00
D. Berge
906dcc6a7e
Make event id serial rather than plain integer
2020-09-06 14:49:42 +02:00
D. Berge
3e949f6185
Add meta fields to schema.
...
Many tables now have a JSON (jsonb) column to
hold unstructured data.
2020-09-06 13:37:11 +02:00
D. Berge
1a9f04aa98
Add NTBP status information to sequences summary
2020-09-01 12:17:21 +02:00
D. Berge
242d35ec80
Update schema: add project summary tables
2020-08-26 20:14:07 +02:00
D. Berge
f3e8205adc
Update schema: add sequences summary view
2020-08-25 17:59:56 +02:00