rails_multisite_discourse 1.0.0 → 1.0.1

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: 992f8e0cc674d6bdc7f6e252940596f006de0c64
4
- data.tar.gz: 0246b02a3da70e424823b77a5c5c69ff2b166885
3
+ metadata.gz: e69f86112ce8f2cdd922388e0705db7a4cbc11d3
4
+ data.tar.gz: be44177ca6b083bd47acea0b2b9bceab55ec5bac
5
5
  SHA512:
6
- metadata.gz: f06bfa63fd47d83ebb99a4a0f5e111c3a238c926386b060101a0990255368a9e8983e70dbbf83096965ad77ee016d56941600f7dd49574219cb69c91eb95a556
7
- data.tar.gz: 9f91b582b0adc7ec741119ae33158bcfc267737670cf947ed0c41cda68f3a709b3e4d33c6f8457ce6ce4347a9b89107e4dfd77eb9845c3025363c0b821f77da1
6
+ metadata.gz: 775c845173bfa0b40ffb3de49ec4144da57185dcbad69b2118d17342ac38ec4d32552ade41226f0e57aba30738bd604f088ef2ef40bdfce3f86967ab5c0c05a0
7
+ data.tar.gz: 0bb58562fef28c92698aff778900c73b1a084c97ab73182a373f4bc5b99c3ba029d4a43ba5910bd2adbfa30fe20a8cb4e85f0694c525917e3ff901316dd72e4b
@@ -1,3 +1,3 @@
1
1
  module RailsMultisite
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -0,0 +1,31 @@
1
+ desc "migrate all sites in tier"
2
+ task "multisite:migrate" => :environment do
3
+ RailsMultisite::ConnectionManagement.each_connection do |db|
4
+ puts "Migrating #{db}"
5
+ puts "---------------------------------\n"
6
+ t = Rake::Task["db:migrate"]
7
+ t.reenable
8
+ t.invoke
9
+ end
10
+ end
11
+
12
+ task "multisite:seed_fu" => :environment do
13
+ RailsMultisite::ConnectionManagement.each_connection do |db|
14
+ puts "Seeding #{db}"
15
+ puts "---------------------------------\n"
16
+ t = Rake::Task["db:seed_fu"]
17
+ t.reenable
18
+ t.invoke
19
+ end
20
+ end
21
+
22
+ desc "rollback migrations for all sites in tier"
23
+ task "multisite:rollback" => :environment do
24
+ RailsMultisite::ConnectionManagement.each_connection do |db|
25
+ puts "Rollback #{db}"
26
+ puts "---------------------------------\n"
27
+ t = Rake::Task["db:rollback"]
28
+ t.reenable
29
+ t.invoke
30
+ end
31
+ end
@@ -0,0 +1,26 @@
1
+ desc "generate multisite config file (if missing)"
2
+ task "multisite:generate:config" => :environment do
3
+ filename = RailsMultisite::ConnectionManagement.config_filename
4
+
5
+ if File.exists?(filename)
6
+ puts "Config is already generated at #{RailsMultisite::ConnectionManagement::CONFIG_FILE}"
7
+ else
8
+ puts "Generated config file at #{RailsMultisite::ConnectionManagement::CONFIG_FILE}"
9
+ File.open(filename, 'w') do |f|
10
+ f.write <<-CONFIG
11
+ # site_name:
12
+ # adapter: postgresql
13
+ # database: db_name
14
+ # host: localhost
15
+ # pool: 5
16
+ # timeout: 5000
17
+ # db_id: 1 # optionally include other settings you need
18
+ # host_names:
19
+ # - www.mysite.com
20
+ # - www.anothersite.com
21
+ CONFIG
22
+
23
+ end
24
+
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_multisite_discourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
@@ -23,6 +23,8 @@ files:
23
23
  - lib/rails_multisite/connection_management.rb
24
24
  - lib/rails_multisite/railtie.rb
25
25
  - lib/rails_multisite/version.rb
26
+ - lib/tasks/db.rake
27
+ - lib/tasks/generators.rake
26
28
  homepage: ''
27
29
  licenses: []
28
30
  metadata: {}