Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1147 from nextcloud/bugfix/oracle
- Loading branch information
Showing
5 changed files
with
142 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: PHPUnit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- stable* | ||
|
||
env: | ||
APP_NAME: groupfolders | ||
|
||
jobs: | ||
oci: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
# do not stop on another job's failure | ||
fail-fast: false | ||
matrix: | ||
php-versions: ['7.4'] | ||
databases: ['oci'] | ||
server-versions: ['master'] | ||
|
||
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} | ||
|
||
services: | ||
oracle: | ||
image: deepdiver/docker-oracle-xe-11g # "wnameless/oracle-xe-11g-r2" | ||
ports: | ||
- "1521:1521" | ||
|
||
steps: | ||
- name: Checkout server | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: nextcloud/server | ||
ref: ${{ matrix.server-versions }} | ||
|
||
- name: Checkout submodules | ||
shell: bash | ||
run: | | ||
auth_header="$(git config --local --get http.https://github.com/.extraheader)" | ||
git submodule sync --recursive | ||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 | ||
- name: Checkout app | ||
uses: actions/checkout@v2 | ||
with: | ||
path: apps/${{ env.APP_NAME }} | ||
|
||
- name: Set up PHPUnit | ||
working-directory: apps/${{ env.APP_NAME }} | ||
run: composer i | ||
|
||
- name: Set up php ${{ matrix.php-versions }} | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-versions }}" | ||
extensions: mbstring, iconv, fileinfo, intl, oci8 | ||
tools: phpunit:8.5.2 | ||
coverage: none | ||
|
||
- name: Set up Nextcloud | ||
run: | | ||
mkdir data | ||
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin | ||
php -f index.php | ||
./occ app:enable --force ${{ env.APP_NAME }} | ||
- name: PHPUnit | ||
working-directory: apps/${{ env.APP_NAME }}/tests | ||
run: phpunit -c phpunit.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @author Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
namespace OCA\GroupFolders\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version802000Date20201119112624 extends SimpleMigrationStep { | ||
|
||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
|
||
$result = $this->ensureColumnIsNullable($schema, 'group_folders', 'acl'); | ||
|
||
// There might be a duplicate column group which was already indexed through being primary key in Version401001Date20190715092137 | ||
$table = $schema->getTable('group_folders_manage'); | ||
if ($table->hasIndex('groups_folder_manage_unique')) { | ||
$table->dropIndex('groups_folder_manage_unique'); | ||
$result = true; | ||
} | ||
|
||
return $result ? $schema : null; | ||
} | ||
|
||
protected function ensureColumnIsNullable(ISchemaWrapper $schema, string $tableName, string $columnName): bool { | ||
$table = $schema->getTable($tableName); | ||
$column = $table->getColumn($columnName); | ||
|
||
if ($column->getNotnull()) { | ||
$column->setNotnull(false); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} |