message-db 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05aba4ba55c67b72468a6a2eb0ead4a34aa118d623ad6bf2d990f93667844d7b
4
- data.tar.gz: 3f5dffc0a1b7937c81aed25b44a6452ea657b4aa0228cde5d5fcc2c6cff4d6d4
3
+ metadata.gz: 7892ee4f77dad72c6a2b193e29f13b9505a0daf6fcd81ba66afc46d5c127da77
4
+ data.tar.gz: b3410f3f9e26e1e4b27295ffd80f80631ff1246293b28efd601d5afaa85afafd
5
5
  SHA512:
6
- metadata.gz: 026ee92f3f70c16925bad32c715c88ec5f954a46a77f6bca5d2dde24f3033db2d835e4ef34c60ca836046783cfaba1a49fd158b286f0a97166624e7c2c5e62f2
7
- data.tar.gz: 6a4ce07368961c35d49097802e8a948b7450d0006a29b6f1948f630fa25b01bf18652d66659a91a0d3a2e286d2c3ddc6acc71a27cb201af542a9c804c7bb66e3
6
+ metadata.gz: 19444da029ffaa0ec179bae754aea49b8a8cac5530ccfc8ac12c0aca0339768ed884c626d6f9a5e6a9d77d2f4e853d1712f45ad475282984e537180608061e47
7
+ data.tar.gz: 6c7b04fc9433b07d92bdfe53cdd034a6e6def05258bfded0aa09586fc6fe3c93fb39a048adcd36e0cd37fa3fb170a1c701c46f07e72026043f40216d70d4c6b3
data/database/VERSION.txt CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.2.2
@@ -101,9 +101,13 @@ BEGIN
101
101
 
102
102
  _command := _command || '
103
103
  ORDER BY
104
- global_position ASC
105
- LIMIT
106
- $3';
104
+ global_position ASC';
105
+
106
+ IF get_category_messages.batch_size != -1 THEN
107
+ _command := _command || '
108
+ LIMIT
109
+ $3';
110
+ END IF;
107
111
 
108
112
  IF current_setting('message_store.debug_get', true) = 'on' OR current_setting('message_store.debug', true) = 'on' THEN
109
113
  RAISE NOTICE '» get_category_messages';
@@ -49,9 +49,13 @@ BEGIN
49
49
 
50
50
  _command := _command || '
51
51
  ORDER BY
52
- position ASC
53
- LIMIT
54
- $3';
52
+ position ASC';
53
+
54
+ IF get_stream_messages.batch_size != -1 THEN
55
+ _command := _command || '
56
+ LIMIT
57
+ $3';
58
+ END IF;
55
59
 
56
60
  IF current_setting('message_store.debug_get', true) = 'on' OR current_setting('message_store.debug', true) = 'on' THEN
57
61
  RAISE NOTICE '» get_stream_messages';
@@ -2,7 +2,7 @@ CREATE OR REPLACE FUNCTION message_store.message_store_version()
2
2
  RETURNS varchar
3
3
  AS $$
4
4
  BEGIN
5
- RETURN '1.2.1';
5
+ RETURN '1.2.2';
6
6
  END;
7
7
  $$ LANGUAGE plpgsql
8
8
  VOLATILE;
@@ -0,0 +1,12 @@
1
+ # 1.2.2 Update
2
+
3
+ Note: There are no backward-incompatible changes in this update.
4
+
5
+ This update requires the execution of the v1.2.2 update script: `1.2.2.sh`. For instructions on applying update scripts, see:
6
+
7
+ [http://docs.eventide-project.org/user-guide/message-db/update.html](http://docs.eventide-project.org/user-guide/message-db/update.html)
8
+
9
+ The following changes are made by the 1.2.2.sh update script:
10
+
11
+ - The `get_category_messages` server function will return the entire, unlimited extent of messages in a category if -1 is sent as the `batch_size` argument
12
+ - The `get_stream_messages` server function will return the entire, unlimited extent of messages in a stream if -1 is sent as the `batch_size` argument
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ echo
6
+ echo "Message DB"
7
+ echo
8
+ echo "Update the message_store database to v1.2.2"
9
+ echo
10
+ echo "WARNING:"
11
+ echo "This script updates a post-v1 message_store database to Message DB v1.2.2"
12
+ echo "Do not run this script on a Message DB pre-v1 database"
13
+ echo
14
+ echo "Fore more information about the changes made to the message store by"
15
+ echo "this update, see: https://github.com/message-db/message-db/blob/master/database/update/1.2.2.md"
16
+ echo
17
+ echo "- Press CTRL+C to stop this script from running"
18
+ echo "- Press RETURN to allow the script to proceed"
19
+ echo
20
+
21
+ read
22
+
23
+ function script_dir {
24
+ val="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
25
+ echo "$val"
26
+ }
27
+
28
+ base="$(script_dir)/.."
29
+ echo $base
30
+
31
+ echo
32
+ echo "Updating Database"
33
+ echo "Version: $(cat $base/VERSION.txt)"
34
+ echo "= = ="
35
+
36
+ if [ -z ${DATABASE_NAME+x} ]; then
37
+ echo "(DATABASE_NAME is not set. Default will be used.)"
38
+ database=message_store
39
+ export DATABASE_NAME=$database
40
+ else
41
+ database=$DATABASE_NAME
42
+ fi
43
+ echo
44
+
45
+ if [ -z ${PGOPTIONS+x} ]; then
46
+ export PGOPTIONS='-c client_min_messages=warning'
47
+ fi
48
+
49
+ function install-functions {
50
+ echo "» get_stream_messages function"
51
+ psql $database -q -f $base/functions/get-stream-messages.sql
52
+
53
+ echo "» get_category_messages function"
54
+ psql $database -q -f $base/functions/get-category-messages.sql
55
+ }
56
+
57
+ echo "Installing Functions"
58
+ echo "- - -"
59
+ install-functions
60
+ echo
61
+
62
+ echo "= = ="
63
+ echo "Done Updating Database"
64
+ echo "Version: $(cat $base/VERSION.txt)"
65
+ echo
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: scripts
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-05-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " "
14
14
  email: opensource@eventide-project.org
@@ -81,6 +81,8 @@ files:
81
81
  - database/update.sh
82
82
  - database/update/1.0.0.md
83
83
  - database/update/1.0.0.sh
84
+ - database/update/1.2.2.md
85
+ - database/update/1.2.2.sh
84
86
  - database/views/category-type-summary.sql
85
87
  - database/views/stream-summary.sql
86
88
  - database/views/stream-type-summary.sql