We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8b273b5 + a99be98 commit 1c1acd8Copy full SHA for 1c1acd8
1 file changed
config/initializers/apartment.rb
@@ -72,6 +72,13 @@
72
# end
73
74
#
75
+ # Executed after the creation of a new Tenant. This is useful for creating extensions or running setup specific to a Tenant.
76
+ config.before_create = lambda do |tenant_name|
77
+ ActiveRecord::Base.connection.execute(<<-SQL)
78
+ SELECT deploy_postgis();
79
+ SQL
80
+ end
81
+
82
config.tenant_names = lambda do
83
ActiveRecord::Base.connection
84
.execute("SELECT schema_name FROM information_schema.schemata WHERE schema_name LIKE 'workspace-%';")
0 commit comments