neo4j 8.0.0.rc.3 → 8.0.0.rc.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/neo4j/active_node/query/query_proxy_methods.rb +1 -1
- data/lib/neo4j/errors.rb +4 -3
- data/lib/neo4j/migrations.rb +2 -1
- data/lib/neo4j/migrations/base.rb +3 -2
- data/lib/neo4j/migrations/helpers.rb +4 -0
- data/lib/neo4j/migrations/helpers/schema.rb +3 -3
- data/lib/neo4j/migrations/migration_file.rb +2 -2
- data/lib/neo4j/migrations/runner.rb +5 -4
- data/lib/neo4j/shared/callbacks.rb +1 -1
- data/lib/neo4j/version.rb +1 -1
- data/neo4j.gemspec +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: 1b6f28cae082dd5d5a620b0457212c98dd62e6b9
|
4
|
+
data.tar.gz: c48ce9f1276d4508edab08259ca059d742eba72c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 626708e743a96d88e228aee34ce2de20b826cc1b867f4fa13ddf64f3e7b6d767261c319e0b53effd1aa9a038257aa7e9d98e327510b2a3ee21e844147f6a6b4e
|
7
|
+
data.tar.gz: 10533ee448ed072bb458b8a15e6373656bdd3235c4b263f02e559a4f504a89f2c6d9a495794872b33a479227e4eddb3e6cb4144db33227f67b1a5d5e4fb7455b
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,20 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
8
8
|
## [8.0.0.rc.3] 2016-10-12
|
9
9
|
|
10
|
+
### Changed
|
11
|
+
|
12
|
+
- `find_or_create_by` on an association does not look for nodes which aren't related to the node in question (thanks for the report @efatsi / see #1240)
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
|
16
|
+
- Inconsistent `drop_constraint` and `drop_index` behavior: they were accepting `force` option (like `add_*` methods)
|
17
|
+
- `PendingMigrationError` not showing pending migrations versions
|
18
|
+
- Fixed `silenced: true` for `Neo4j::Migration::Runner` option, not working properly
|
19
|
+
- Removed "strange" inheritance between Neo4j::Migrations::Base and the legacy Neo4j::Migration class
|
20
|
+
- Avoid creating the `SchemaMigration` model constraint when it already exists
|
21
|
+
|
22
|
+
## [8.0.0.rc.3] 2016-10-12
|
23
|
+
|
10
24
|
# Added
|
11
25
|
|
12
26
|
- `distinct` method for QueryProxy (thanks @ProGM / see #1305)
|
data/lib/neo4j/errors.rb
CHANGED
@@ -34,11 +34,12 @@ module Neo4j
|
|
34
34
|
|
35
35
|
# Inspired/taken from active_record/migration.rb
|
36
36
|
class PendingMigrationError < MigrationError
|
37
|
-
def initialize
|
37
|
+
def initialize(migrations)
|
38
|
+
pending_migrations = migrations.join("\n")
|
38
39
|
if rails? && defined?(Rails.env)
|
39
|
-
super("Migrations are pending
|
40
|
+
super("Migrations are pending:\n#{pending_migrations}\n To resolve this issue, run:\n\n #{command_name} neo4j:migrate RAILS_ENV=#{::Rails.env}")
|
40
41
|
else
|
41
|
-
super("Migrations are pending
|
42
|
+
super("Migrations are pending:\n#{pending_migrations}\n To resolve this issue, run:\n\n #{command_name} neo4j:migrate")
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
data/lib/neo4j/migrations.rb
CHANGED
@@ -11,7 +11,8 @@ module Neo4j
|
|
11
11
|
class << self
|
12
12
|
def check_for_pending_migrations!
|
13
13
|
runner = Neo4j::Migrations::Runner.new
|
14
|
-
|
14
|
+
pending = runner.pending_migrations
|
15
|
+
fail ::Neo4j::PendingMigrationError, pending if pending.any?
|
15
16
|
end
|
16
17
|
|
17
18
|
attr_accessor :currently_running_migrations
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module Neo4j
|
2
2
|
module Migrations
|
3
|
-
class Base
|
3
|
+
class Base
|
4
4
|
include Neo4j::Migrations::Helpers
|
5
5
|
include Neo4j::Migrations::Helpers::Schema
|
6
6
|
include Neo4j::Migrations::Helpers::IdProperty
|
7
7
|
include Neo4j::Migrations::Helpers::Relationships
|
8
8
|
|
9
|
-
def initialize(migration_id)
|
9
|
+
def initialize(migration_id, options = {})
|
10
10
|
@migration_id = migration_id
|
11
|
+
@silenced = options[:silenced]
|
11
12
|
end
|
12
13
|
|
13
14
|
def migrate(method)
|
@@ -24,13 +24,13 @@ module Neo4j
|
|
24
24
|
def drop_constraint(label, property, options = {})
|
25
25
|
type = options[:type] || :uniqueness
|
26
26
|
label_object = ActiveBase.label_object(label)
|
27
|
-
fail_missing_constraint_or_index!(:constraint, label, property) if !label_object.constraint?(property)
|
27
|
+
fail_missing_constraint_or_index!(:constraint, label, property) if !options[:force] && !label_object.constraint?(property)
|
28
28
|
label_object.drop_constraint(property, type: type)
|
29
29
|
end
|
30
30
|
|
31
|
-
def drop_index(label, property)
|
31
|
+
def drop_index(label, property, options = {})
|
32
32
|
label_object = ActiveBase.label_object(label)
|
33
|
-
fail_missing_constraint_or_index!(:index, label, property) if !label_object.index?(property)
|
33
|
+
fail_missing_constraint_or_index!(:index, label, property) if !options[:force] && !label_object.index?(property)
|
34
34
|
label_object.drop_index(property)
|
35
35
|
end
|
36
36
|
|
@@ -13,7 +13,8 @@ module Neo4j
|
|
13
13
|
|
14
14
|
def initialize(options = {})
|
15
15
|
@silenced = options[:silenced] || !!ENV['MIGRATIONS_SILENCED']
|
16
|
-
SchemaMigration.mapped_label
|
16
|
+
label = SchemaMigration.mapped_label
|
17
|
+
label.create_constraint(:migration_id, type: :unique) unless label.constraint?(:migration_id)
|
17
18
|
@schema_migrations = SchemaMigration.all.to_a
|
18
19
|
@up_versions = SortedSet.new(@schema_migrations.map(&:migration_id))
|
19
20
|
end
|
@@ -47,8 +48,8 @@ module Neo4j
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
50
|
-
def pending_migrations
|
51
|
-
all_migrations.
|
51
|
+
def pending_migrations
|
52
|
+
all_migrations.select { |migration| !up?(migration) }
|
52
53
|
end
|
53
54
|
|
54
55
|
def status
|
@@ -110,7 +111,7 @@ MSG
|
|
110
111
|
|
111
112
|
def migrate(direction, migration_file)
|
112
113
|
migration_message(direction, migration_file) do
|
113
|
-
migration = migration_file.create
|
114
|
+
migration = migration_file.create(silenced: @silenced)
|
114
115
|
migration.migrate(direction)
|
115
116
|
end
|
116
117
|
end
|
data/lib/neo4j/version.rb
CHANGED
data/neo4j.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.required_ruby_version = ((RUBY_PLATFORM == 'java') ? '>= 1.9.3' : '>= 2.1.9')
|
12
12
|
|
13
13
|
s.authors = 'Andreas Ronge, Brian Underwood, Chris Grigg'
|
14
|
-
s.email = 'andreas.ronge@gmail.com,
|
14
|
+
s.email = 'andreas.ronge@gmail.com, public@brian-underwood.codes, chris@subvertallmedia.com'
|
15
15
|
s.homepage = 'https://github.com/neo4jrb/neo4j/'
|
16
16
|
s.rubyforge_project = 'neo4j'
|
17
17
|
s.summary = 'A graph database for Ruby'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.0.0.rc.
|
4
|
+
version: 8.0.0.rc.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge, Brian Underwood, Chris Grigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: orm_adapter
|
@@ -214,7 +214,7 @@ description: 'A Neo4j OGM (Object-Graph-Mapper) for use in Ruby on Rails and Rac
|
|
214
214
|
frameworks heavily inspired by ActiveRecord.
|
215
215
|
|
216
216
|
'
|
217
|
-
email: andreas.ronge@gmail.com,
|
217
|
+
email: andreas.ronge@gmail.com, public@brian-underwood.codes, chris@subvertallmedia.com
|
218
218
|
executables:
|
219
219
|
- neo4j-jars
|
220
220
|
extensions: []
|