sequelize-rails 0.6.0 → 0.6.1
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 +6 -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: ed358e5bb7080bb8fe4c713a46b295cb7cd1c51de02cda2b6daf0580e2ae42be
|
4
|
+
data.tar.gz: 8382be25407a695811c735ca4bf93e4eddf709cc86bb9d501b948f2bfb090ec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f940cf5b229febd629e5a06ecf9d7c69cfb5a6e0ca36ede15bdcbebd3e836ea919b83eb8d20e9658d2a4339d26e3663684aab0781c20657a564a99d4ad9935e1
|
7
|
+
data.tar.gz: b9fea39afcb85fe6bfd7659e470f676b1df28e49355a90598f9e3a10fdf4011686c7d200f8e73790282a9de09839d92dc8afd95f75684090db168345eaa3d348
|
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,13 @@
|
|
1
1
|
Sequel.migration do
|
2
2
|
up do
|
3
|
-
|
3
|
+
transaction do
|
4
|
+
run File.read(File.join(File.dirname(__FILE__), "#{File.basename(__FILE__, ".rb")}_up.sql"))
|
5
|
+
end
|
4
6
|
end
|
5
7
|
|
6
8
|
down do
|
7
|
-
|
9
|
+
transaction do
|
10
|
+
run File.read(File.join(File.dirname(__FILE__), "#{File.basename(__FILE__, ".rb")}_down.sql"))
|
11
|
+
end
|
8
12
|
end
|
9
13
|
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.1
|
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
|