2014-11-15 23:32:19 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-03-26 01:36:22 +08:00
|
|
|
set -e
|
|
|
|
|
2014-11-15 23:32:19 +08:00
|
|
|
SUBDOMAIN="dev"
|
2015-05-16 05:27:12 +08:00
|
|
|
PASSWORD="pass1234"
|
|
|
|
ADMIN_PASSWORD="pass1234"
|
2014-11-15 23:32:19 +08:00
|
|
|
EMAIL="dev@example.com"
|
|
|
|
|
|
|
|
echo "--- Creating databases"
|
2016-03-26 01:36:22 +08:00
|
|
|
rake cartodb:db:setup
|
|
|
|
|
|
|
|
echo "--- Create '${SUBDOMAIN}' user"
|
|
|
|
rake cartodb:db:create_user --trace SUBDOMAIN="${SUBDOMAIN}" \
|
2014-11-15 23:32:19 +08:00
|
|
|
PASSWORD="${PASSWORD}" ADMIN_PASSWORD="${ADMIN_PASSWORD}" \
|
|
|
|
EMAIL="${EMAIL}"
|
|
|
|
|
|
|
|
# # Update your quota to 100GB
|
|
|
|
echo "--- Updating quota to 100GB"
|
2016-03-26 01:36:22 +08:00
|
|
|
rake cartodb:db:set_user_quota["${SUBDOMAIN}",102400]
|
2014-11-15 23:32:19 +08:00
|
|
|
|
|
|
|
# # Allow unlimited tables to be created
|
|
|
|
echo "--- Allowing unlimited tables creation"
|
2016-03-26 01:36:22 +08:00
|
|
|
rake cartodb:db:set_unlimited_table_quota["${SUBDOMAIN}"]
|
2014-11-15 23:32:19 +08:00
|
|
|
|
|
|
|
# # Allow user to create private tables in addition to public
|
|
|
|
echo "--- Allowing private tables creation"
|
2016-03-26 01:36:22 +08:00
|
|
|
rake cartodb:db:set_user_private_tables_enabled["${SUBDOMAIN}",'true']
|
2014-11-15 23:32:19 +08:00
|
|
|
|
|
|
|
# # Set the account type
|
|
|
|
echo "--- Setting cartodb account type"
|
2016-03-26 01:36:22 +08:00
|
|
|
rake cartodb:db:set_user_account_type["${SUBDOMAIN}",'[DEDICATED]']
|
2017-04-07 04:24:10 +08:00
|
|
|
|
|
|
|
# Set dataservices server
|
|
|
|
rake cartodb:db:configure_geocoder_extension_for_non_org_users[$SUBDOMAIN]
|
2017-08-02 04:07:30 +08:00
|
|
|
|
|
|
|
# Enable sync tables
|
|
|
|
echo "UPDATE users SET sync_tables_enabled=true WHERE username='${SUBDOMAIN}'" | psql -U postgres -t carto_db_development
|