Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/initializers/apartment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@
# end
# end
#
# Executed after the creation of a new Tenant. This is useful for creating extensions or running setup specific to a Tenant.
config.before_create = lambda do |tenant_name|
ActiveRecord::Base.connection.execute(<<-SQL)
SELECT deploy_postgis();
SQL
end

config.tenant_names = lambda do
ActiveRecord::Base.connection
.execute("SELECT schema_name FROM information_schema.schemata WHERE schema_name LIKE 'workspace-%';")
Expand Down
Loading