sbf-dm-migrations 1.4.0.beta.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dm-migrations.gemspec +1 -1
- data/lib/dm-migrations/adapters/dm-sqlite-adapter.rb +11 -9
- data/lib/dm-migrations/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 364280b8cfc35a881eb0f05ca5c1e3aa88c3ab6731603ab0b730e4854b7deb3a
|
4
|
+
data.tar.gz: bcc983b46986eb87ff48ff8cd9c245a64e5d3babe2e89d38ed1d032717a91968
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ce1d89a09d134d6ebe925bc2639c1d79589ceb19858f1d063512a96fb3e61324e714750e2bf42c4073dbb2df2f4acb8a9b1342db1e2ad355d7dbcdff43acf90
|
7
|
+
data.tar.gz: 8f8c2af3acc9afbf53aae4304c9281e6c81d5709c0730c25b17fd456b9060f2ea7196806862e9e4f7ac113e9ff586ef9d7d52e9830b55cd58f6d3d12c0598810
|
data/dm-migrations.gemspec
CHANGED
@@ -4,7 +4,7 @@ require 'dm-migrations/adapters/dm-do-adapter'
|
|
4
4
|
module DataMapper
|
5
5
|
module Migrations
|
6
6
|
module SqliteAdapter
|
7
|
-
include
|
7
|
+
include DataObjectsAdapter
|
8
8
|
|
9
9
|
# @api private
|
10
10
|
def self.included(base)
|
@@ -14,12 +14,12 @@ module DataMapper
|
|
14
14
|
|
15
15
|
# @api semipublic
|
16
16
|
def storage_exists?(storage_name)
|
17
|
-
|
17
|
+
table_info(storage_name).any?
|
18
18
|
end
|
19
19
|
|
20
20
|
# @api semipublic
|
21
21
|
def field_exists?(storage_name, column_name)
|
22
|
-
|
22
|
+
table_info(storage_name).any? do |row|
|
23
23
|
row.name == column_name
|
24
24
|
end
|
25
25
|
end
|
@@ -28,22 +28,22 @@ module DataMapper
|
|
28
28
|
# private ## This cannot be private for current migrations
|
29
29
|
|
30
30
|
# @api private
|
31
|
-
def
|
31
|
+
def supports_serial?
|
32
32
|
@supports_serial ||= sqlite_version >= '3.1.0'
|
33
33
|
end
|
34
34
|
|
35
35
|
# @api private
|
36
|
-
def
|
36
|
+
def supports_drop_table_if_exists?
|
37
37
|
@supports_drop_table_if_exists ||= sqlite_version >= '3.3.0'
|
38
38
|
end
|
39
39
|
|
40
40
|
# @api private
|
41
|
-
def
|
41
|
+
def table_info(table_name)
|
42
42
|
select("PRAGMA table_info(#{quote_name(table_name)})")
|
43
43
|
end
|
44
44
|
|
45
45
|
# @api private
|
46
|
-
def
|
46
|
+
def create_table_statement(connection, model, properties)
|
47
47
|
statement = DataMapper::Ext::String.compress_lines(<<-SQL)
|
48
48
|
CREATE TABLE #{quote_name(model.storage_name(name))}
|
49
49
|
(#{properties.map { |property| property_schema_statement(connection, property_schema_hash(property)) }.join(', ')}
|
@@ -59,7 +59,7 @@ module DataMapper
|
|
59
59
|
end
|
60
60
|
|
61
61
|
# @api private
|
62
|
-
def
|
62
|
+
def property_schema_statement(connection, schema)
|
63
63
|
statement = super
|
64
64
|
|
65
65
|
statement << ' PRIMARY KEY AUTOINCREMENT' if supports_serial? && schema[:serial]
|
@@ -68,11 +68,13 @@ module DataMapper
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# @api private
|
71
|
-
def
|
71
|
+
def sqlite_version
|
72
72
|
@sqlite_version ||= select('SELECT sqlite_version(*)').first.freeze
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
include SQL
|
77
|
+
|
76
78
|
module ClassMethods
|
77
79
|
# Types for SQLite 3 databases.
|
78
80
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sbf-dm-migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- opensource_firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sbf-dm-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.3
|
19
|
+
version: '1.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.3
|
26
|
+
version: '1.3'
|
27
27
|
description: DataMapper plugin for modifying and maintaining database structure, triggers,
|
28
28
|
stored procedures, and data
|
29
29
|
email:
|
@@ -110,9 +110,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: 2.7.8
|
111
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- - "
|
113
|
+
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
115
|
+
version: '0'
|
116
116
|
requirements: []
|
117
117
|
rubygems_version: 3.4.10
|
118
118
|
signing_key:
|