Skip to content

Commit

Permalink
Merge pull request #228 from palantirnet/dev-42-drupal-load-db
Browse files Browse the repository at this point in the history
DEV-42 - Drop database tables when running load-db.
  • Loading branch information
becw authored Nov 16, 2023
2 parents d0c33df + 3c75279 commit c7c947f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"pear/http_request2": "^2.3",
"pear/versioncontrol_git": "@dev",
"phing/phing": "^2.14",
"phpmd/phpmd": "^2.4",
"phpmd/phpmd": "2.13",
"phpspec/prophecy-phpunit": "^2"
},
"autoload": {
Expand Down
4 changes: 4 additions & 0 deletions defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ drupal:
# $> phing load-db -Ddb.load.file=artifacts/foo.sql.gz
#file:

drop_db:
# Command to drop the database tables.
mysql_command: drush sql-drop -y


# Configuration for targets/artifact.xml
artifact:
Expand Down
5 changes: 5 additions & 0 deletions targets/drupal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ Or, you can specify the export file directly:
</then>
</if>

<!-- Drop the database tables. -->
<property name="drupal.site.drop_db.command" value="${drupal.site.drop_db.mysql_command}" />
<echo>$> ${drupal.site.drop_db.command}</echo>
<exec dir="${build.dir}" command="${drupal.site.drop_db.command}" checkreturn="true" logoutput="true" />

<!-- Load the contents of the file into Drupal -->
<property name="drupal.site.load_db.command" value="${drupal.site.load_db.contents_command} ${drupal.site.load_db.file} | ${drupal.site.load_db.mysql_command}" />
<echo>$> ${drupal.site.load_db.command}</echo>
Expand Down

0 comments on commit c7c947f

Please sign in to comment.