Skip to content

Commit

Permalink
Merge pull request #834 from pnax/create-db-script
Browse files Browse the repository at this point in the history
Use a unique set of definitions to initialize the database
  • Loading branch information
Alexandre Pion committed Sep 15, 2021
2 parents 0430cf5 + 98d79c2 commit 0460c26
Show file tree
Hide file tree
Showing 13 changed files with 355 additions and 484 deletions.
16 changes: 7 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,15 @@ before_install:
- ln -s ../../../../share ./lib/auto/share/dist/Zonemaster-Backend

before_script:
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -c "create user travis_zonemaster WITH PASSWORD 'travis_zonemaster';" -U postgres; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -c 'create database travis_zonemaster OWNER travis_zonemaster;' -U postgres; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -U postgres -c "CREATE USER travis_zonemaster WITH PASSWORD 'travis_zonemaster';"; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -U postgres -c 'CREATE DATABASE travis_zonemaster OWNER travis_zonemaster;'; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then cpanm DBD::Pg; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then perl -I./lib ./script/create_db_postgresql_9.3.pl; fi

- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "CREATE USER 'travis_zm'@'localhost' IDENTIFIED BY 'travis_zonemaster';" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "CREATE DATABASE travis_zonemaster CHARACTER SET utf8 COLLATE utf8_bin;" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "GRANT ALL ON travis_zonemaster.* TO 'travis_zm'@'localhost';" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "FLUSH PRIVILEGES;" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then cpanm --force DBD::mysql; fi
- if [[ "$TARGET" == "MySQL" ]]; then perl -I./lib ./script/create_db_mysql.pl; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -u root -e "CREATE USER 'travis_zm'@'localhost' IDENTIFIED BY 'travis_zonemaster';"; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -u root -e "CREATE DATABASE travis_zonemaster CHARACTER SET utf8 COLLATE utf8_bin;"; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -u root -e "GRANT ALL ON travis_zonemaster.* TO 'travis_zm'@'localhost';"; fi
- if [[ "$TARGET" == "MySQL" ]]; then cpanm DBD::mysql; fi

script:
- perl -I./lib ./share/create_db.pl
- perl Makefile.PL && make test
6 changes: 1 addition & 5 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,15 @@ MANIFEST This list of files
META.yml
README.md
script/add-batch-job.pl
script/create_db_mysql.pl
script/create_db_postgresql_9.3.pl
script/zmb
script/zmtest
script/zonemaster_backend_rpcapi.psgi
script/zonemaster_backend_testagent
share/backend_config.ini
share/cleanup-mysql.sql
share/cleanup-postgres.sql
share/create_db_sqlite.pl
share/create_db.pl
share/freebsd-pwd.conf
share/initial-mysql.sql
share/initial-postgres.sql
share/patch_db_README.txt
share/patch_mysql_db_zonemaster_backend_ver_1.0.3.pl
share/patch_mysql_db_zonemaster_backend_ver_5.0.0.pl
Expand Down
Loading

0 comments on commit 0460c26

Please sign in to comment.