forked from directus/directus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecd452b
commit 5f0b8e5
Showing
422 changed files
with
1,130 additions
and
757 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
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
24 changes: 24 additions & 0 deletions
24
migrations/upgrades/schemas/20190626114228_add_file_naming_in_setting.php
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,24 @@ | ||
<?php | ||
use Phinx\Migration\AbstractMigration; | ||
use function GuzzleHttp\json_encode; | ||
|
||
class AddFileNamingInSetting extends AbstractMigration | ||
{ | ||
public function up() | ||
{ | ||
$fieldObject = [ | ||
'field' => 'file_naming', | ||
'type' => 'string', | ||
'interface' => 'dropdown', | ||
'options' => ['choices' => ['uuid' => 'File Hash (Obfuscated)', 'file_name' => 'File Name (Readable)']] | ||
]; | ||
$collection = 'directus_settings'; | ||
$checkSql = sprintf('SELECT 1 FROM `directus_fields` WHERE `collection` = "%s" AND `field` = "%s";', $collection, $fieldObject['field']); | ||
$result = $this->query($checkSql)->fetch(); | ||
if (!$result) { | ||
$insertSqlFormat = "INSERT INTO `directus_fields` (`collection`, `field`, `type`, `interface`, `options`) VALUES ('%s', '%s', '%s', '%s' , '%s');"; | ||
$insertSql = sprintf($insertSqlFormat, $collection, $fieldObject['field'], $fieldObject['type'], $fieldObject['interface'], json_encode($fieldObject['options'])); | ||
$this->execute($insertSql); | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.