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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e51567c1bfeb0099d9ca2a8953255ec891b31b53
4
- data.tar.gz: 193f42f0d37cc85d28556c97bcd471a2038a4486
3
+ metadata.gz: 5f7134595e82eab6150c6c24ee82c0fff9c39845
4
+ data.tar.gz: ad14e7624de3cae7fcb7fe3d6664af11bb5732a8
5
5
  SHA512:
6
- metadata.gz: e7e417f24f82605260e6217ead40a68c47df2b318a0c16b477fc53a1c7f9d85e5538b925fa3e0ff00cd3b8589ba2324ec6130fc70cd2bf86b9323f6a028d9b9a
7
- data.tar.gz: 352737990690066a06ac50b6d7f9145c1307e5161c7b039a5f1017a9ee605ec9bcae4a973eeacf32f10b87d4bde5ef7da48949ce81443701163095e5460f6b18
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
- c.create_table tbl if !c.table_exists?(tbl)
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
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.7.82'
2
+ VERSION = '0.7.83'
3
3
  end
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.82
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-09 00:00:00.000000000 Z
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.4.5.1
1240
+ rubygems_version: 2.5.1
1241
1241
  signing_key:
1242
1242
  specification_version: 4
1243
1243
  summary: CMS built on rails.