sequelize-rails 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/sequel/generators/migration_generator.rb +2 -0
- data/lib/sequel/generators/templates/down.sql.erb +1 -0
- data/lib/sequel/generators/templates/migration.rb.erb +3 -2
- data/lib/sequel/generators/templates/up.sql.erb +1 -0
- data/lib/sequel/rails/version.rb +1 -1
- data/lib/sequel/tasks.rake +11 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70e996b8b359c9a17b548d9739a3c073de2e90925e2d1d03e7df9a9ab97eec20
|
4
|
+
data.tar.gz: 9050241fa762162d5f5512e453a9dbddf6225df1f2573fd99e6ef6617d1e7cc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98376659022b9357a37c8ad474f4f258aa77dd4357c3fef63e33b3e231e63d255aaefc28e98817daf207626a5126f38a847e0f8d725bd27ec7b81511622a3fdd
|
7
|
+
data.tar.gz: fb462d27082f7f01c90d6c13ac83fbc62fe707a616c717e9f25c36f810b7954932d3ece4756ac70dfd07b2662e47a90621dc04445192b1d49c4e7d4d216e881b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -15,6 +15,8 @@ module Sequel
|
|
15
15
|
|
16
16
|
def create_migration_file
|
17
17
|
migration_template "migration.rb.erb", "db/migrate/#{file_name}.rb"
|
18
|
+
migration_template "up.sql.erb", "db/migrate/#{file_name}_up.sql"
|
19
|
+
migration_template "down.sql.erb", "db/migrate/#{file_name}_down.sql"
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
-- Write rollback migration here
|
@@ -1,9 +1,10 @@
|
|
1
1
|
Sequel.migration do
|
2
|
+
transaction
|
2
3
|
up do
|
3
|
-
|
4
|
+
run File.read(File.join(File.dirname(__FILE__), "#{File.basename(__FILE__, ".rb")}_up.sql"))
|
4
5
|
end
|
5
6
|
|
6
7
|
down do
|
7
|
-
|
8
|
+
run File.read(File.join(File.dirname(__FILE__), "#{File.basename(__FILE__, ".rb")}_down.sql"))
|
8
9
|
end
|
9
10
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
-- Write forwards migration here
|
data/lib/sequel/rails/version.rb
CHANGED
data/lib/sequel/tasks.rake
CHANGED
@@ -141,7 +141,17 @@ db_namespace = namespace ns do
|
|
141
141
|
end
|
142
142
|
|
143
143
|
desc "Rolls back the last migration and re-runs it"
|
144
|
-
task redo: [:
|
144
|
+
task redo: [:connection] do
|
145
|
+
# down
|
146
|
+
target = (migrator.applied_migrations[-2] || "0_").split("_", 2).first.to_i
|
147
|
+
migrator(target: target).run
|
148
|
+
# up
|
149
|
+
pending = migrator.migration_tuples.first
|
150
|
+
if pending
|
151
|
+
target = pending[1].split("_", 2).first.to_i
|
152
|
+
migrator(target: target).run
|
153
|
+
end
|
154
|
+
end
|
145
155
|
|
146
156
|
desc "Displays the status of the database migrations"
|
147
157
|
task status: [:connection] do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequelize-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenaniah Cerny
|
@@ -165,7 +165,9 @@ files:
|
|
165
165
|
- lib/sequel/generators/migration_generator.rb
|
166
166
|
- lib/sequel/generators/model_generator.rb
|
167
167
|
- lib/sequel/generators/templates/application_record.rb.tt
|
168
|
+
- lib/sequel/generators/templates/down.sql.erb
|
168
169
|
- lib/sequel/generators/templates/migration.rb.erb
|
170
|
+
- lib/sequel/generators/templates/up.sql.erb
|
169
171
|
- lib/sequel/plugins/pretty_print.rb
|
170
172
|
- lib/sequel/rails.rb
|
171
173
|
- lib/sequel/rails/db_console.rb
|