1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00
Files
peeringdb-peeringdb/config/facsimile/tmpl/_ALL_/init.sql

24 lines
1.1 KiB
MySQL
Raw Normal View History

2018-11-09 07:27:36 +00:00
{% for k, each in module.iteritems() %}
{% if each.db %}
{% if each.db.name %}
2018-11-09 07:38:15 +00:00
create database if not exists {{env.rc.db.default.prefix}}{{each.db.name}} character set = utf8;
grant all on {{env.rc.db.default.prefix}}{{each.db.name}}.* to '{{env.rc.db.default.prefix}}{{each.name}}'@'localhost' identified by '{{each.password}}';
grant all on {{env.rc.db.default.prefix}}{{each.db.name}}.* to '{{env.rc.db.default.prefix}}{{each.name}}'@'%.%.int' identified by '{{each.password}}';
2018-11-09 07:27:36 +00:00
{% endif %}
{% for table in each.db.selectable %}
2018-11-09 07:38:15 +00:00
grant select on {{table}} to '{{env.rc.db.default.prefix}}{{each.name}}'@'localhost' identified by '{{each.password}}';
grant select on {{table}} to '{{env.rc.db.default.prefix}}{{each.name}}'@'%.%.int' identified by '{{each.password}}';
2018-11-09 07:27:36 +00:00
{% endfor %}
{% for table in each.db.writable %}
2018-11-09 07:38:15 +00:00
grant all on {{table}} to '{{env.rc.db.default.prefix}}{{each.name}}'@'localhost' identified by '{{each.password}}';
grant all on {{table}} to '{{env.rc.db.default.prefix}}{{each.name}}'@'%.%.int' identified by '{{each.password}}';
2018-11-09 07:27:36 +00:00
{% endfor %}
{% endif %}
{% endfor %}
flush privileges;