caboose-cms 0.7.82 → 0.7.83
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/caboose/utilities/schema.rb +12 -3
- data/lib/caboose/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f7134595e82eab6150c6c24ee82c0fff9c39845
|
4
|
+
data.tar.gz: ad14e7624de3cae7fcb7fe3d6664af11bb5732a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38c658b6f26840717cabd52da7c463df939cdc072752b36d59d4c47a3e6573983639bf4e7ca168800d78f5098da2f58139d3be3178242ed2459b7bd8905c650f
|
7
|
+
data.tar.gz: 5b0ae8114f3bbbfdbcf6b3334dea0fcdaa1de2e08b5cc0cdb7921e64c953c5730d699668ea694d1e1cd1842e217abc0739460db5aead07289c831987bf245efb
|
@@ -46,8 +46,14 @@ class Caboose::Utilities::Schema
|
|
46
46
|
c = ActiveRecord::Base.connection
|
47
47
|
self.schema.each do |model, columns|
|
48
48
|
tbl = model.table_name
|
49
|
-
puts "Creating table #{tbl}..."
|
50
|
-
|
49
|
+
puts "Creating table #{tbl}..."
|
50
|
+
if !c.table_exists?(tbl)
|
51
|
+
if model.primary_key != 'id'
|
52
|
+
c.create_table tbl, { :id => false, :force => true }
|
53
|
+
else
|
54
|
+
c.create_table tbl
|
55
|
+
end
|
56
|
+
end
|
51
57
|
columns.each do |col|
|
52
58
|
puts "Creating column #{tbl}.#{col[0]}..."
|
53
59
|
|
@@ -72,8 +78,11 @@ class Caboose::Utilities::Schema
|
|
72
78
|
else
|
73
79
|
c.execute("alter table #{tbl} alter column #{col[0]} type #{col[1]} using cast(#{col[0]} as #{col[1]})")
|
74
80
|
|
81
|
+
end
|
82
|
+
if col[0].to_s == model.primary_key
|
83
|
+
c.execute("alter table #{tbl} add primary key (\"#{col[0].to_s}\")")
|
75
84
|
end
|
76
|
-
end
|
85
|
+
end
|
77
86
|
end
|
78
87
|
|
79
88
|
create_indexes
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.83
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -1237,7 +1237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1237
1237
|
version: '0'
|
1238
1238
|
requirements: []
|
1239
1239
|
rubyforge_project:
|
1240
|
-
rubygems_version: 2.
|
1240
|
+
rubygems_version: 2.5.1
|
1241
1241
|
signing_key:
|
1242
1242
|
specification_version: 4
|
1243
1243
|
summary: CMS built on rails.
|