1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

fix init.sql inclusion

This commit is contained in:
Stefan Pratter
2018-11-09 07:27:36 +00:00
parent d7be56df70
commit 4fa98c3792
2 changed files with 23 additions and 1 deletions

1
.gitignore vendored
View File

@@ -3,7 +3,6 @@
.facsimile
*.pyc
*.log
*.sql
*.swp
OLD.*
genstatic/

View File

@@ -0,0 +1,23 @@
{% for k, each in module.iteritems() %}
{% if each.db %}
{% if each.db.name %}
create database if not exists {{env.rc.db.prefix}}{{each.db.name}} character set = utf8;
grant all on {{env.rc.db.prefix}}{{each.db.name}}.* to '{{env.rc.db.prefix}}{{each.name}}'@'localhost' identified by '{{each.password}}';
grant all on {{env.rc.db.prefix}}{{each.db.name}}.* to '{{env.rc.db.prefix}}{{each.name}}'@'%.%.int' identified by '{{each.password}}';
{% endif %}
{% for table in each.db.selectable %}
grant select on {{table}} to '{{env.rc.db.prefix}}{{each.name}}'@'localhost' identified by '{{each.password}}';
grant select on {{table}} to '{{env.rc.db.prefix}}{{each.name}}'@'%.%.int' identified by '{{each.password}}';
{% endfor %}
{% for table in each.db.writable %}
grant all on {{table}} to '{{env.rc.db.prefix}}{{each.name}}'@'localhost' identified by '{{each.password}}';
grant all on {{table}} to '{{env.rc.db.prefix}}{{each.name}}'@'%.%.int' identified by '{{each.password}}';
{% endfor %}
{% endif %}
{% endfor %}
flush privileges;