postqueue 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/postqueue/item.rb +20 -2
- data/lib/postqueue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab5c97e45f6171bf141d58d1cd8ce8c5524f5b2
|
4
|
+
data.tar.gz: 0a1b8ef785008bec26a6907024617a4ef4a82a3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31fad4af31402d2084e07c0b60baa14bce82a53efba6714056956f52da1360cfd5b92a6a0f6599789f687290ec743f867604346c4bc7a16c930aa52a69071585
|
7
|
+
data.tar.gz: a7c2117c1abdee7840cfa66714e99ad15bd8a02456454d4f4d44ce9a00e019df5224e722c7e4f415116331bb3c3e2a08bb14b77d0204dd9c51a0941dcaaa305a
|
data/README.md
CHANGED
data/lib/postqueue/item.rb
CHANGED
@@ -22,10 +22,28 @@ module Postqueue
|
|
22
22
|
SQL
|
23
23
|
end
|
24
24
|
|
25
|
+
def self.upgrade_table!(table_name)
|
26
|
+
# upgrade id column to use BIGINT if necessary
|
27
|
+
id_max = Item.column_types['id'].send(:range).end
|
28
|
+
if id_max <= 2147483648
|
29
|
+
STDERR.puts "Changing type of #{table_name}.id column to BIGINT"
|
30
|
+
Item.connection.execute "ALTER TABLE #{table_name} ALTER COLUMN id TYPE BIGINT"
|
31
|
+
Item.connection.execute "ALTER SEQUENCE #{table_name}_id_seq RESTART WITH 2147483649"
|
32
|
+
Item.reset_column_information
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
25
36
|
def self.migrate!(table_name = "postqueue")
|
26
|
-
Item.connection
|
37
|
+
connection = Item.connection
|
38
|
+
|
39
|
+
if connection.tables.include?(table_name)
|
40
|
+
upgrade_table!(table_name)
|
41
|
+
return
|
42
|
+
end
|
43
|
+
|
44
|
+
connection.execute <<-SQL
|
27
45
|
CREATE TABLE #{table_name} (
|
28
|
-
id
|
46
|
+
id BIGSERIAL PRIMARY KEY,
|
29
47
|
op VARCHAR,
|
30
48
|
entity_id INTEGER NOT NULL DEFAULT 0,
|
31
49
|
created_at timestamp without time zone NOT NULL DEFAULT (now() at time zone 'utc'),
|
data/lib/postqueue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postqueue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- radiospiel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|