mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
Fix migration
This commit is contained in:
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||||
|
use Doctrine\DBAL\Migrations\AbstractMigration as BaseMigration;
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\DBAL\Migrations\Configuration;
|
||||||
|
use Doctrine\ORM\EntityManager;
|
||||||
|
|
||||||
|
abstract class AbstractMigration extends BaseMigration
|
||||||
|
{
|
||||||
|
/** @var EntityManager */
|
||||||
|
private $em;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets EntityManager.
|
||||||
|
*
|
||||||
|
* @param EntityManager $em
|
||||||
|
*
|
||||||
|
* @return AbstractMigration
|
||||||
|
*/
|
||||||
|
public function setEntityManager(EntityManager $em)
|
||||||
|
{
|
||||||
|
$this->em = $em;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets EntityManager.
|
||||||
|
*
|
||||||
|
* @return EntityManager
|
||||||
|
*
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public function getEntityManager()
|
||||||
|
{
|
||||||
|
if (null === $this->em) {
|
||||||
|
throw new RuntimeException('EntityManager must be injected.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public function up(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
||||||
|
|
||||||
|
$this->doUpSql($schema);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public function down(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
||||||
|
|
||||||
|
$this->doDownSql($schema);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Executes update SQL.
|
||||||
|
*/
|
||||||
|
abstract public function doUpSql(Schema $schema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute downgrade SQL.
|
||||||
|
*/
|
||||||
|
abstract public function doDownSql(Schema $schema);
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
|
class AggregateTokenMigration extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function doUpSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("CREATE TABLE IF NOT EXISTS AggregateTokens (id INT AUTO_INCREMENT NOT NULL, usr_id INT NOT NULL, value VARCHAR(12) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doDownSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("DROP TABLE AggregateTokens");
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
|
class AuthFailureMigration extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function doUpSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("CREATE TABLE IF NOT EXISTS AuthFailures (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(128) NOT NULL, ip VARCHAR(128) DEFAULT NULL, locked TINYINT(1) NOT NULL, created DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doDownSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("DROP TABLE AuthFailures");
|
||||||
|
}
|
||||||
|
}
|
@@ -1,39 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\ORM\Query\ResultSetMapping;
|
||||||
|
|
||||||
/**
|
class FeedMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version320alpha4 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$app = new Application();
|
|
||||||
|
|
||||||
$rsm = new ResultSetMapping();
|
|
||||||
$rsm->addScalarResult('Name', 'Name');
|
|
||||||
|
|
||||||
$found = false;
|
|
||||||
|
|
||||||
foreach ($app['EM']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
|
|
||||||
if (strcmp('feeds', $row['Name'])) {
|
|
||||||
$found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($found) {
|
|
||||||
$this->addSql("RENAME TABLE `feeds` TO `feeds_backup`");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Feeds (id INT AUTO_INCREMENT NOT NULL, public TINYINT(1) NOT NULL, icon_url TINYINT(1) NOT NULL, base_id INT DEFAULT NULL, title VARCHAR(128) NOT NULL, subtitle VARCHAR(1024) DEFAULT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS Feeds (id INT AUTO_INCREMENT NOT NULL, public TINYINT(1) NOT NULL, icon_url TINYINT(1) NOT NULL, base_id INT DEFAULT NULL, title VARCHAR(128) NOT NULL, subtitle VARCHAR(1024) DEFAULT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FeedPublishers (id INT AUTO_INCREMENT NOT NULL, feed_id INT DEFAULT NULL, usr_id INT NOT NULL, owner TINYINT(1) NOT NULL, created_on DATETIME NOT NULL, INDEX IDX_31AFAB251A5BC03 (feed_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS FeedPublishers (id INT AUTO_INCREMENT NOT NULL, feed_id INT DEFAULT NULL, usr_id INT NOT NULL, owner TINYINT(1) NOT NULL, created_on DATETIME NOT NULL, INDEX IDX_31AFAB251A5BC03 (feed_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FeedEntries (id INT AUTO_INCREMENT NOT NULL, publisher_id INT DEFAULT NULL, feed_id INT DEFAULT NULL, title VARCHAR(128) NOT NULL, subtitle VARCHAR(128) NOT NULL, author_name VARCHAR(128) NOT NULL, author_email VARCHAR(128) NOT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, INDEX IDX_5FC892F940C86FCE (publisher_id), INDEX IDX_5FC892F951A5BC03 (feed_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS FeedEntries (id INT AUTO_INCREMENT NOT NULL, publisher_id INT DEFAULT NULL, feed_id INT DEFAULT NULL, title VARCHAR(128) NOT NULL, subtitle VARCHAR(128) NOT NULL, author_name VARCHAR(128) NOT NULL, author_email VARCHAR(128) NOT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, INDEX IDX_5FC892F940C86FCE (publisher_id), INDEX IDX_5FC892F951A5BC03 (feed_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
@@ -46,11 +30,8 @@ class Version320alpha4 extends AbstractMigration
|
|||||||
$this->addSql("ALTER TABLE FeedTokens ADD CONSTRAINT FK_9D1CA84851A5BC03 FOREIGN KEY (feed_id) REFERENCES Feeds (id)");
|
$this->addSql("ALTER TABLE FeedTokens ADD CONSTRAINT FK_9D1CA84851A5BC03 FOREIGN KEY (feed_id) REFERENCES Feeds (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE FeedPublishers DROP FOREIGN KEY FK_31AFAB251A5BC03");
|
$this->addSql("ALTER TABLE FeedPublishers DROP FOREIGN KEY FK_31AFAB251A5BC03");
|
||||||
$this->addSql("ALTER TABLE FeedEntries DROP FOREIGN KEY FK_5FC892F951A5BC03");
|
$this->addSql("ALTER TABLE FeedEntries DROP FOREIGN KEY FK_5FC892F951A5BC03");
|
||||||
$this->addSql("ALTER TABLE FeedTokens DROP FOREIGN KEY FK_9D1CA84851A5BC03");
|
$this->addSql("ALTER TABLE FeedTokens DROP FOREIGN KEY FK_9D1CA84851A5BC03");
|
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
|
class FtpCredentialMigration extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function doUpSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("CREATE TABLE IF NOT EXISTS FtpCredential (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usrId INT NOT NULL, active TINYINT(1) NOT NULL, address VARCHAR(128) NOT NULL, login VARCHAR(128) NOT NULL, password VARCHAR(128) NOT NULL, reception_folder VARCHAR(128) NOT NULL, repository_prefix_name VARCHAR(128) NOT NULL, passive TINYINT(1) NOT NULL, tls TINYINT(1) NOT NULL, max_retry INT NOT NULL, updated DATETIME NOT NULL, UNIQUE INDEX UNIQ_62DA9661A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doDownSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("DROP TABLE FtpCredential");
|
||||||
|
}
|
||||||
|
}
|
@@ -1,30 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class FtpExportMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha6 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FtpExportElements (id INT AUTO_INCREMENT NOT NULL, export_id INT DEFAULT NULL, record_id INT NOT NULL, base_id INT NOT NULL, subdef VARCHAR(255) NOT NULL, filename VARCHAR(255) NOT NULL, folder VARCHAR(255) DEFAULT NULL, error TINYINT(1) NOT NULL, done TINYINT(1) NOT NULL, businessfields TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_7BF0AE1264CDAF82 (export_id), INDEX done (done), INDEX error (error), UNIQUE INDEX unique_ftp_export (export_id, base_id, record_id, subdef), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS FtpExportElements (id INT AUTO_INCREMENT NOT NULL, export_id INT DEFAULT NULL, record_id INT NOT NULL, base_id INT NOT NULL, subdef VARCHAR(255) NOT NULL, filename VARCHAR(255) NOT NULL, folder VARCHAR(255) DEFAULT NULL, error TINYINT(1) NOT NULL, done TINYINT(1) NOT NULL, businessfields TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_7BF0AE1264CDAF82 (export_id), INDEX done (done), INDEX error (error), UNIQUE INDEX unique_ftp_export (export_id, base_id, record_id, subdef), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FtpExports (id INT AUTO_INCREMENT NOT NULL, crash INT NOT NULL, nbretry INT NOT NULL, mail LONGTEXT DEFAULT NULL, addr LONGTEXT NOT NULL, use_ssl TINYINT(1) NOT NULL, login LONGTEXT DEFAULT NULL, pwd LONGTEXT DEFAULT NULL, passif TINYINT(1) NOT NULL, destfolder LONGTEXT NOT NULL, sendermail LONGTEXT DEFAULT NULL, text_mail_sender LONGTEXT DEFAULT NULL, text_mail_receiver LONGTEXT DEFAULT NULL, usr_id INT NOT NULL, foldertocreate LONGTEXT DEFAULT NULL, logfile TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS FtpExports (id INT AUTO_INCREMENT NOT NULL, crash INT NOT NULL, nbretry INT NOT NULL, mail LONGTEXT DEFAULT NULL, addr LONGTEXT NOT NULL, use_ssl TINYINT(1) NOT NULL, login LONGTEXT DEFAULT NULL, pwd LONGTEXT DEFAULT NULL, passif TINYINT(1) NOT NULL, destfolder LONGTEXT NOT NULL, sendermail LONGTEXT DEFAULT NULL, text_mail_sender LONGTEXT DEFAULT NULL, text_mail_receiver LONGTEXT DEFAULT NULL, usr_id INT NOT NULL, foldertocreate LONGTEXT DEFAULT NULL, logfile TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("ALTER TABLE FtpExportElements ADD CONSTRAINT FK_7BF0AE1264CDAF82 FOREIGN KEY (export_id) REFERENCES FtpExports (id)");
|
$this->addSql("ALTER TABLE FtpExportElements ADD CONSTRAINT FK_7BF0AE1264CDAF82 FOREIGN KEY (export_id) REFERENCES FtpExports (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE FtpExportElements DROP FOREIGN KEY FK_7BF0AE1264CDAF82");
|
$this->addSql("ALTER TABLE FtpExportElements DROP FOREIGN KEY FK_7BF0AE1264CDAF82");
|
||||||
$this->addSql("DROP TABLE FtpExportElements");
|
$this->addSql("DROP TABLE FtpExportElements");
|
||||||
$this->addSql("DROP TABLE FtpExports");
|
$this->addSql("DROP TABLE FtpExports");
|
@@ -1,20 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class LazaretMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version370alpha7 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS LazaretChecks (id INT AUTO_INCREMENT NOT NULL, lazaret_file_id INT DEFAULT NULL, checkClassname VARCHAR(512) NOT NULL, INDEX IDX_CE873ED44CF84ADD (lazaret_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS LazaretChecks (id INT AUTO_INCREMENT NOT NULL, lazaret_file_id INT DEFAULT NULL, checkClassname VARCHAR(512) NOT NULL, INDEX IDX_CE873ED44CF84ADD (lazaret_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS LazaretSessions (id INT AUTO_INCREMENT NOT NULL, usr_id INT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS LazaretSessions (id INT AUTO_INCREMENT NOT NULL, usr_id INT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS LazaretAttributes (id INT AUTO_INCREMENT NOT NULL, lazaret_file_id INT DEFAULT NULL, name VARCHAR(64) NOT NULL, value VARCHAR(2048) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_5FF72F9B4CF84ADD (lazaret_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS LazaretAttributes (id INT AUTO_INCREMENT NOT NULL, lazaret_file_id INT DEFAULT NULL, name VARCHAR(64) NOT NULL, value VARCHAR(2048) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_5FF72F9B4CF84ADD (lazaret_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
@@ -24,11 +26,8 @@ class Version370alpha7 extends AbstractMigration
|
|||||||
$this->addSql("ALTER TABLE LazaretFiles ADD CONSTRAINT FK_D30BD768EE187C01 FOREIGN KEY (lazaret_session_id) REFERENCES LazaretSessions (id)");
|
$this->addSql("ALTER TABLE LazaretFiles ADD CONSTRAINT FK_D30BD768EE187C01 FOREIGN KEY (lazaret_session_id) REFERENCES LazaretSessions (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE LazaretFiles DROP FOREIGN KEY FK_D30BD768EE187C01");
|
$this->addSql("ALTER TABLE LazaretFiles DROP FOREIGN KEY FK_D30BD768EE187C01");
|
||||||
$this->addSql("ALTER TABLE LazaretChecks DROP FOREIGN KEY FK_CE873ED44CF84ADD");
|
$this->addSql("ALTER TABLE LazaretChecks DROP FOREIGN KEY FK_CE873ED44CF84ADD");
|
||||||
$this->addSql("ALTER TABLE LazaretAttributes DROP FOREIGN KEY FK_5FF72F9B4CF84ADD");
|
$this->addSql("ALTER TABLE LazaretAttributes DROP FOREIGN KEY FK_5FF72F9B4CF84ADD");
|
@@ -1,31 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class OrderMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha1b extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Orders (id INT AUTO_INCREMENT NOT NULL, basket_id INT DEFAULT NULL, usr_id INT NOT NULL, order_usage VARCHAR(2048) NOT NULL, todo INT DEFAULT NULL, deadline DATETIME NOT NULL, created_on DATETIME NOT NULL, UNIQUE INDEX UNIQ_E283F8D81BE1FB52 (basket_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS Orders (id INT AUTO_INCREMENT NOT NULL, basket_id INT DEFAULT NULL, usr_id INT NOT NULL, order_usage VARCHAR(2048) NOT NULL, todo INT DEFAULT NULL, deadline DATETIME NOT NULL, created_on DATETIME NOT NULL, UNIQUE INDEX UNIQ_E283F8D81BE1FB52 (basket_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS OrderElements (id INT AUTO_INCREMENT NOT NULL, order_id INT DEFAULT NULL, base_id INT NOT NULL, record_id INT NOT NULL, order_master_id INT DEFAULT NULL, deny TINYINT(1) DEFAULT NULL, INDEX IDX_8C7066C88D9F6D38 (order_id), UNIQUE INDEX unique_ordercle (base_id, record_id, order_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS OrderElements (id INT AUTO_INCREMENT NOT NULL, order_id INT DEFAULT NULL, base_id INT NOT NULL, record_id INT NOT NULL, order_master_id INT DEFAULT NULL, deny TINYINT(1) DEFAULT NULL, INDEX IDX_8C7066C88D9F6D38 (order_id), UNIQUE INDEX unique_ordercle (base_id, record_id, order_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("ALTER TABLE Orders ADD CONSTRAINT FK_E283F8D81BE1FB52 FOREIGN KEY (basket_id) REFERENCES Baskets (id)");
|
$this->addSql("ALTER TABLE Orders ADD CONSTRAINT FK_E283F8D81BE1FB52 FOREIGN KEY (basket_id) REFERENCES Baskets (id)");
|
||||||
$this->addSql("ALTER TABLE OrderElements ADD CONSTRAINT FK_8C7066C88D9F6D38 FOREIGN KEY (order_id) REFERENCES Orders (id)");
|
$this->addSql("ALTER TABLE OrderElements ADD CONSTRAINT FK_8C7066C88D9F6D38 FOREIGN KEY (order_id) REFERENCES Orders (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE OrderElements DROP FOREIGN KEY FK_8C7066C88D9F6D38");
|
$this->addSql("ALTER TABLE OrderElements DROP FOREIGN KEY FK_8C7066C88D9F6D38");
|
||||||
$this->addSql("DROP TABLE Orders");
|
$this->addSql("DROP TABLE Orders");
|
||||||
$this->addSql("DROP TABLE OrderElements");
|
$this->addSql("DROP TABLE OrderElements");
|
@@ -1,30 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class SessionMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version380alpha11 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS SessionModules (id INT AUTO_INCREMENT NOT NULL, session_id INT DEFAULT NULL, module_id INT NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_BA36EF49613FECDF (session_id), UNIQUE INDEX unique_module (session_id, module_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS SessionModules (id INT AUTO_INCREMENT NOT NULL, session_id INT DEFAULT NULL, module_id INT NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_BA36EF49613FECDF (session_id), UNIQUE INDEX unique_module (session_id, module_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Sessions (id INT AUTO_INCREMENT NOT NULL, usr_id INT NOT NULL, user_agent VARCHAR(512) NOT NULL, ip_address VARCHAR(40) DEFAULT NULL, platform VARCHAR(128) DEFAULT NULL, browser_name VARCHAR(128) DEFAULT NULL, browser_version VARCHAR(32) DEFAULT NULL, screen_width INT DEFAULT NULL, screen_height INT DEFAULT NULL, token VARCHAR(128) DEFAULT NULL, nonce VARCHAR(16) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, UNIQUE INDEX UNIQ_6316FF455F37A13B (token), INDEX usr_id (usr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS Sessions (id INT AUTO_INCREMENT NOT NULL, usr_id INT NOT NULL, user_agent VARCHAR(512) NOT NULL, ip_address VARCHAR(40) DEFAULT NULL, platform VARCHAR(128) DEFAULT NULL, browser_name VARCHAR(128) DEFAULT NULL, browser_version VARCHAR(32) DEFAULT NULL, screen_width INT DEFAULT NULL, screen_height INT DEFAULT NULL, token VARCHAR(128) DEFAULT NULL, nonce VARCHAR(16) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, UNIQUE INDEX UNIQ_6316FF455F37A13B (token), INDEX usr_id (usr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("ALTER TABLE SessionModules ADD CONSTRAINT FK_BA36EF49613FECDF FOREIGN KEY (session_id) REFERENCES Sessions (id)");
|
$this->addSql("ALTER TABLE SessionModules ADD CONSTRAINT FK_BA36EF49613FECDF FOREIGN KEY (session_id) REFERENCES Sessions (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE SessionModules DROP FOREIGN KEY FK_BA36EF49613FECDF");
|
$this->addSql("ALTER TABLE SessionModules DROP FOREIGN KEY FK_BA36EF49613FECDF");
|
||||||
$this->addSql("DROP TABLE SessionModules");
|
$this->addSql("DROP TABLE SessionModules");
|
||||||
$this->addSql("DROP TABLE Sessions");
|
$this->addSql("DROP TABLE Sessions");
|
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
|
class TaskMigration extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function doUpSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("CREATE TABLE IF NOT EXISTS Tasks (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, jobId VARCHAR(255) NOT NULL, settings LONGTEXT NOT NULL, completed TINYINT(1) NOT NULL, status VARCHAR(255) NOT NULL, crashed INT NOT NULL, single_run TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, last_execution DATETIME DEFAULT NULL, period INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doDownSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("DROP TABLE Tasks");
|
||||||
|
}
|
||||||
|
}
|
@@ -1,29 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class UserMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha2 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Users (id INT AUTO_INCREMENT NOT NULL, model_of INT DEFAULT NULL, login VARCHAR(128) NOT NULL, email VARCHAR(128) DEFAULT NULL, password VARCHAR(128) DEFAULT NULL, nonce VARCHAR(16) DEFAULT NULL, salted_password TINYINT(1) NOT NULL, first_name VARCHAR(64) NOT NULL, last_name VARCHAR(64) NOT NULL, gender VARCHAR(8) DEFAULT NULL, address LONGTEXT NOT NULL, city VARCHAR(64) NOT NULL, country VARCHAR(64) NOT NULL, zip_code VARCHAR(32) NOT NULL, geoname_id INT DEFAULT NULL, locale VARCHAR(8) DEFAULT NULL, timezone VARCHAR(128) NOT NULL, job VARCHAR(128) NOT NULL, activity VARCHAR(256) NOT NULL, company VARCHAR(64) NOT NULL, phone VARCHAR(32) NOT NULL, fax VARCHAR(32) NOT NULL, admin TINYINT(1) NOT NULL, guest TINYINT(1) NOT NULL, mail_notifications TINYINT(1) NOT NULL, request_notifications TINYINT(1) NOT NULL, ldap_created TINYINT(1) NOT NULL, last_model VARCHAR(64) DEFAULT NULL, push_list LONGTEXT NOT NULL, can_change_profil TINYINT(1) NOT NULL, can_change_ftp_profil TINYINT(1) NOT NULL, last_connection DATETIME DEFAULT NULL, mail_locked TINYINT(1) NOT NULL, deleted TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, UNIQUE INDEX UNIQ_D5428AEDC121714D (model_of), INDEX salted_password (salted_password), INDEX admin (admin), INDEX guest (guest), UNIQUE INDEX email_unique (email), UNIQUE INDEX login_unique (login), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS Users (id INT AUTO_INCREMENT NOT NULL, model_of INT DEFAULT NULL, login VARCHAR(128) NOT NULL, email VARCHAR(128) DEFAULT NULL, password VARCHAR(128) DEFAULT NULL, nonce VARCHAR(16) DEFAULT NULL, salted_password TINYINT(1) NOT NULL, first_name VARCHAR(64) NOT NULL, last_name VARCHAR(64) NOT NULL, gender VARCHAR(8) DEFAULT NULL, address LONGTEXT NOT NULL, city VARCHAR(64) NOT NULL, country VARCHAR(64) NOT NULL, zip_code VARCHAR(32) NOT NULL, geoname_id INT DEFAULT NULL, locale VARCHAR(8) DEFAULT NULL, timezone VARCHAR(128) NOT NULL, job VARCHAR(128) NOT NULL, activity VARCHAR(256) NOT NULL, company VARCHAR(64) NOT NULL, phone VARCHAR(32) NOT NULL, fax VARCHAR(32) NOT NULL, admin TINYINT(1) NOT NULL, guest TINYINT(1) NOT NULL, mail_notifications TINYINT(1) NOT NULL, request_notifications TINYINT(1) NOT NULL, ldap_created TINYINT(1) NOT NULL, last_model VARCHAR(64) DEFAULT NULL, push_list LONGTEXT NOT NULL, can_change_profil TINYINT(1) NOT NULL, can_change_ftp_profil TINYINT(1) NOT NULL, last_connection DATETIME DEFAULT NULL, mail_locked TINYINT(1) NOT NULL, deleted TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, UNIQUE INDEX UNIQ_D5428AEDC121714D (model_of), INDEX salted_password (salted_password), INDEX admin (admin), INDEX guest (guest), UNIQUE INDEX email_unique (email), UNIQUE INDEX login_unique (login), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("ALTER TABLE Users ADD CONSTRAINT FK_D5428AEDC121714D FOREIGN KEY (model_of) REFERENCES Users (id)");
|
$this->addSql("ALTER TABLE Users ADD CONSTRAINT FK_D5428AEDC121714D FOREIGN KEY (model_of) REFERENCES Users (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE Users DROP FOREIGN KEY FK_D5428AEDC121714D");
|
$this->addSql("ALTER TABLE Users DROP FOREIGN KEY FK_D5428AEDC121714D");
|
||||||
$this->addSql("DROP TABLE Users");
|
$this->addSql("DROP TABLE Users");
|
||||||
}
|
}
|
@@ -1,29 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class UserNotificationSettingMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha5 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS UserNotificationSettings (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usr_id INT NOT NULL, name VARCHAR(64) NOT NULL, value VARCHAR(128) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_CFF041AAA76ED395 (user_id), UNIQUE INDEX unique_index (user_id, name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS UserNotificationSettings (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usr_id INT NOT NULL, name VARCHAR(64) NOT NULL, value VARCHAR(128) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_CFF041AAA76ED395 (user_id), UNIQUE INDEX unique_index (user_id, name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("ALTER TABLE UserNotificationSettings ADD CONSTRAINT FK_CFF041AAA76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
|
$this->addSql("ALTER TABLE UserNotificationSettings ADD CONSTRAINT FK_CFF041AAA76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("DROP TABLE UserNotificationSettings");
|
$this->addSql("DROP TABLE UserNotificationSettings");
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
|
class UserQueryMigration extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function doUpSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("CREATE TABLE IF NOT EXISTS UserQueries (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usr_id INT NOT NULL, query VARCHAR(256) NOT NULL, created DATETIME NOT NULL, INDEX IDX_5FB80D87A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
|
$this->addSql("ALTER TABLE UserQueries ADD CONSTRAINT FK_5FB80D87A76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function doDownSql(Schema $schema)
|
||||||
|
{
|
||||||
|
$this->addSql("DROP TABLE UserQueries");
|
||||||
|
}
|
||||||
|
}
|
@@ -1,29 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class UserSettingMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha4 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS UserSettings (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usr_id INT NOT NULL, name VARCHAR(64) NOT NULL, value VARCHAR(128) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_2847E61CA76ED395 (user_id), UNIQUE INDEX unique_setting (user_id, name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS UserSettings (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usr_id INT NOT NULL, name VARCHAR(64) NOT NULL, value VARCHAR(128) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_2847E61CA76ED395 (user_id), UNIQUE INDEX unique_setting (user_id, name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("ALTER TABLE UserSettings ADD CONSTRAINT FK_2847E61CA76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
|
$this->addSql("ALTER TABLE UserSettings ADD CONSTRAINT FK_2847E61CA76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("DROP TABLE UserSettings");
|
$this->addSql("DROP TABLE UserSettings");
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version370alpha8 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema)
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Tasks (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, jobId VARCHAR(255) NOT NULL, settings LONGTEXT NOT NULL, completed TINYINT(1) NOT NULL, status VARCHAR(255) NOT NULL, crashed INT NOT NULL, single_run TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, last_execution DATETIME DEFAULT NULL, period INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema)
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("DROP TABLE Tasks");
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version380alpha4 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema)
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS AuthFailures (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(128) NOT NULL, ip VARCHAR(128) DEFAULT NULL, locked TINYINT(1) NOT NULL, created DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema)
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("DROP TABLE AuthFailures");
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha1a extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema)
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FtpCredential (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usrId INT NOT NULL, active TINYINT(1) NOT NULL, address VARCHAR(128) NOT NULL, login VARCHAR(128) NOT NULL, password VARCHAR(128) NOT NULL, reception_folder VARCHAR(128) NOT NULL, repository_prefix_name VARCHAR(128) NOT NULL, passive TINYINT(1) NOT NULL, tls TINYINT(1) NOT NULL, max_retry INT NOT NULL, updated DATETIME NOT NULL, UNIQUE INDEX UNIQ_62DA9661A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("ALTER TABLE FtpCredential ADD CONSTRAINT FK_62DA9661A76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema)
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("DROP TABLE FtpCredential");
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha3 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema)
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS UserQueries (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, usr_id INT NOT NULL, query VARCHAR(256) NOT NULL, created DATETIME NOT NULL, INDEX IDX_5FB80D87A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("ALTER TABLE UserQueries ADD CONSTRAINT FK_5FB80D87A76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema)
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("DROP TABLE UserQueries");
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\ORM\Query\ResultSetMapping;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha7 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema)
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$app = new Application();
|
|
||||||
|
|
||||||
$rsm = new ResultSetMapping();
|
|
||||||
$rsm->addScalarResult('Name', 'Name');
|
|
||||||
|
|
||||||
$found = false;
|
|
||||||
|
|
||||||
foreach ($app['EM']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
|
|
||||||
if (strcmp('feeds', $row['Name'])) {
|
|
||||||
$found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($found) {
|
|
||||||
$this->addSql("RENAME TABLE `feeds` TO `feeds_backup`");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Feeds (id INT AUTO_INCREMENT NOT NULL, public TINYINT(1) NOT NULL, icon_url TINYINT(1) NOT NULL, base_id INT DEFAULT NULL, title VARCHAR(128) NOT NULL, subtitle VARCHAR(1024) DEFAULT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FeedPublishers (id INT AUTO_INCREMENT NOT NULL, feed_id INT DEFAULT NULL, usr_id INT NOT NULL, owner TINYINT(1) NOT NULL, created_on DATETIME NOT NULL, INDEX IDX_31AFAB251A5BC03 (feed_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS AggregateTokens (id INT AUTO_INCREMENT NOT NULL, usr_id INT NOT NULL, value VARCHAR(12) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FeedEntries (id INT AUTO_INCREMENT NOT NULL, publisher_id INT DEFAULT NULL, feed_id INT DEFAULT NULL, title VARCHAR(128) NOT NULL, subtitle VARCHAR(128) NOT NULL, author_name VARCHAR(128) NOT NULL, author_email VARCHAR(128) NOT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, INDEX IDX_5FC892F940C86FCE (publisher_id), INDEX IDX_5FC892F951A5BC03 (feed_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FeedItems (id INT AUTO_INCREMENT NOT NULL, entry_id INT DEFAULT NULL, record_id INT NOT NULL, sbas_id INT NOT NULL, ord INT NOT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, INDEX IDX_7F9CDFA6BA364942 (entry_id), UNIQUE INDEX lookup_unique_idx (entry_id, sbas_id, record_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS FeedTokens (id INT AUTO_INCREMENT NOT NULL, feed_id INT DEFAULT NULL, usr_id INT NOT NULL, value VARCHAR(12) DEFAULT NULL, INDEX IDX_9D1CA84851A5BC03 (feed_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
$this->addSql("ALTER TABLE FeedPublishers ADD CONSTRAINT FK_31AFAB251A5BC03 FOREIGN KEY (feed_id) REFERENCES Feeds (id)");
|
|
||||||
$this->addSql("ALTER TABLE FeedEntries ADD CONSTRAINT FK_5FC892F940C86FCE FOREIGN KEY (publisher_id) REFERENCES FeedPublishers (id)");
|
|
||||||
$this->addSql("ALTER TABLE FeedEntries ADD CONSTRAINT FK_5FC892F951A5BC03 FOREIGN KEY (feed_id) REFERENCES Feeds (id)");
|
|
||||||
$this->addSql("ALTER TABLE FeedItems ADD CONSTRAINT FK_7F9CDFA6BA364942 FOREIGN KEY (entry_id) REFERENCES FeedEntries (id)");
|
|
||||||
$this->addSql("ALTER TABLE FeedTokens ADD CONSTRAINT FK_9D1CA84851A5BC03 FOREIGN KEY (feed_id) REFERENCES Feeds (id)");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema)
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE FeedPublishers DROP FOREIGN KEY FK_31AFAB251A5BC03");
|
|
||||||
$this->addSql("ALTER TABLE FeedEntries DROP FOREIGN KEY FK_5FC892F951A5BC03");
|
|
||||||
$this->addSql("ALTER TABLE FeedTokens DROP FOREIGN KEY FK_9D1CA84851A5BC03");
|
|
||||||
$this->addSql("ALTER TABLE FeedEntries DROP FOREIGN KEY FK_5FC892F940C86FCE");
|
|
||||||
$this->addSql("ALTER TABLE FeedItems DROP FOREIGN KEY FK_7F9CDFA6BA364942");
|
|
||||||
$this->addSql("DROP TABLE Feeds");
|
|
||||||
$this->addSql("DROP TABLE FeedPublishers");
|
|
||||||
$this->addSql("DROP TABLE AggregateTokens");
|
|
||||||
$this->addSql("DROP TABLE FeedEntries");
|
|
||||||
$this->addSql("DROP TABLE FeedItems");
|
|
||||||
$this->addSql("DROP TABLE FeedTokens");
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version390alpha8 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema)
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Tasks (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, jobId VARCHAR(255) NOT NULL, settings LONGTEXT NOT NULL, completed TINYINT(1) NOT NULL, status VARCHAR(255) NOT NULL, crashed INT NOT NULL, single_run TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, last_execution DATETIME DEFAULT NULL, period INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema)
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("DROP TABLE Tasks");
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,20 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2013 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
namespace Alchemy\Phrasea\Setup\DoctrineMigrations;
|
||||||
|
|
||||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
|
||||||
/**
|
class WorkzoneMigration extends AbstractMigration
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
class Version360alpha1 extends AbstractMigration
|
|
||||||
{
|
{
|
||||||
public function up(Schema $schema)
|
public function doUpSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS Baskets (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, description LONGTEXT DEFAULT NULL, usr_id INT NOT NULL, is_read TINYINT(1) NOT NULL, pusher_id INT DEFAULT NULL, archived TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS Baskets (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, description LONGTEXT DEFAULT NULL, usr_id INT NOT NULL, is_read TINYINT(1) NOT NULL, pusher_id INT DEFAULT NULL, archived TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS StoryWZ (id INT AUTO_INCREMENT NOT NULL, sbas_id INT NOT NULL, record_id INT NOT NULL, usr_id INT NOT NULL, created DATETIME NOT NULL, UNIQUE INDEX user_story (usr_id, sbas_id, record_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS StoryWZ (id INT AUTO_INCREMENT NOT NULL, sbas_id INT NOT NULL, record_id INT NOT NULL, usr_id INT NOT NULL, created DATETIME NOT NULL, UNIQUE INDEX user_story (usr_id, sbas_id, record_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
$this->addSql("CREATE TABLE IF NOT EXISTS ValidationSessions (id INT AUTO_INCREMENT NOT NULL, basket_id INT DEFAULT NULL, initiator_id INT NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, expires DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_5B9DFB061BE1FB52 (basket_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
$this->addSql("CREATE TABLE IF NOT EXISTS ValidationSessions (id INT AUTO_INCREMENT NOT NULL, basket_id INT DEFAULT NULL, initiator_id INT NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, expires DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_5B9DFB061BE1FB52 (basket_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
|
||||||
@@ -28,25 +30,18 @@ class Version360alpha1 extends AbstractMigration
|
|||||||
$this->addSql("ALTER TABLE ValidationParticipants ADD CONSTRAINT FK_17850D7BF25B0F5B FOREIGN KEY (ValidationSession_id) REFERENCES ValidationSessions (id)");
|
$this->addSql("ALTER TABLE ValidationParticipants ADD CONSTRAINT FK_17850D7BF25B0F5B FOREIGN KEY (ValidationSession_id) REFERENCES ValidationSessions (id)");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema)
|
public function doDownSql(Schema $schema)
|
||||||
{
|
{
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
|
|
||||||
|
|
||||||
$this->addSql("ALTER TABLE ValidationSessions DROP FOREIGN KEY FK_5B9DFB061BE1FB52");
|
$this->addSql("ALTER TABLE ValidationSessions DROP FOREIGN KEY FK_5B9DFB061BE1FB52");
|
||||||
$this->addSql("ALTER TABLE Orders DROP FOREIGN KEY FK_E283F8D81BE1FB52");
|
|
||||||
$this->addSql("ALTER TABLE BasketElements DROP FOREIGN KEY FK_C0B7ECB71BE1FB52");
|
$this->addSql("ALTER TABLE BasketElements DROP FOREIGN KEY FK_C0B7ECB71BE1FB52");
|
||||||
$this->addSql("ALTER TABLE ValidationParticipants DROP FOREIGN KEY FK_17850D7BF25B0F5B");
|
$this->addSql("ALTER TABLE ValidationParticipants DROP FOREIGN KEY FK_17850D7BF25B0F5B");
|
||||||
$this->addSql("ALTER TABLE OrderElements DROP FOREIGN KEY FK_8C7066C88D9F6D38");
|
|
||||||
$this->addSql("ALTER TABLE ValidationDatas DROP FOREIGN KEY FK_70E84DDCE989605");
|
$this->addSql("ALTER TABLE ValidationDatas DROP FOREIGN KEY FK_70E84DDCE989605");
|
||||||
$this->addSql("ALTER TABLE ValidationDatas DROP FOREIGN KEY FK_70E84DDC9D1C3019");
|
$this->addSql("ALTER TABLE ValidationDatas DROP FOREIGN KEY FK_70E84DDC9D1C3019");
|
||||||
$this->addSql("DROP TABLE Baskets");
|
$this->addSql("DROP TABLE Baskets");
|
||||||
$this->addSql("DROP TABLE StoryWZ");
|
$this->addSql("DROP TABLE StoryWZ");
|
||||||
$this->addSql("DROP TABLE ValidationSessions");
|
$this->addSql("DROP TABLE ValidationSessions");
|
||||||
$this->addSql("DROP TABLE Orders");
|
|
||||||
$this->addSql("DROP TABLE ValidationDatas");
|
$this->addSql("DROP TABLE ValidationDatas");
|
||||||
$this->addSql("DROP TABLE BasketElements");
|
$this->addSql("DROP TABLE BasketElements");
|
||||||
$this->addSql("DROP TABLE ValidationParticipants");
|
$this->addSql("DROP TABLE ValidationParticipants");
|
||||||
$this->addSql("DROP TABLE OrderElements");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -827,8 +827,18 @@ abstract class base implements cache_cacheableInterface
|
|||||||
$success = true;
|
$success = true;
|
||||||
|
|
||||||
foreach ($list_patches as $patch) {
|
foreach ($list_patches as $patch) {
|
||||||
if ( ! $patch->apply($this, $app))
|
foreach($patch->getDoctrineMigrations() as $doctrineVersion) {
|
||||||
|
$version = $app['doctrine-migration.configuration']->getVersion($doctrineVersion);
|
||||||
|
$version->getMigration()->setEntityManager($app['EM']);
|
||||||
|
if (false === $version->isMigrated()) {
|
||||||
|
$version->execute('up');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false === $patch->apply($this, $app)) {
|
||||||
$success = false;
|
$success = false;
|
||||||
|
}
|
||||||
|
|
||||||
$upgrader->add_steps_complete(1);
|
$upgrader->add_steps_complete(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,11 +68,15 @@ class module_console_systemUpgrade extends Command
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$upgrader = new Setup_Upgrade($this->container, $input->getOption('force'));
|
$upgrader = new Setup_Upgrade($this->container, $input->getOption('force'));
|
||||||
|
$queries = $this->getService('phraseanet.appbox')->forceUpgrade($upgrader, $this->container);
|
||||||
} catch (\Exception_Setup_FixBadEmailAddresses $e) {
|
} catch (\Exception_Setup_FixBadEmailAddresses $e) {
|
||||||
return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>'));
|
return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>'));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$output->write('<info>'.$e->getMessage().'</info>', true);
|
||||||
|
var_dump($e->getTraceAsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
$queries = $this->getService('phraseanet.appbox')->forceUpgrade($upgrader, $this->container);
|
|
||||||
|
|
||||||
if ($input->getOption('dump')) {
|
if ($input->getOption('dump')) {
|
||||||
if (0 < count($queries)) {
|
if (0 < count($queries)) {
|
||||||
|
@@ -11,49 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha1a implements patchInterface
|
class patch_320alpha1a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.1';
|
private $release = '3.2.0-alpha.1';
|
||||||
|
|
||||||
/**
|
/** @var Array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE record SET parent_record_id = "1"
|
$sql = 'UPDATE record SET parent_record_id = "1"
|
||||||
|
@@ -11,48 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha1b implements patchInterface
|
class patch_320alpha1b implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.1';
|
private $release = '3.2.0-alpha.1';
|
||||||
|
|
||||||
/**
|
/** @var Array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'REPLACE INTO records_rights
|
$sql = 'REPLACE INTO records_rights
|
||||||
|
@@ -11,48 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha2a implements patchInterface
|
class patch_320alpha2a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.2';
|
private $release = '3.2.0-alpha.2';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT * FROM usr WHERE nonce IS NULL';
|
$sql = 'SELECT * FROM usr WHERE nonce IS NULL';
|
||||||
@@ -65,7 +66,7 @@ class patch_320alpha2a implements patchInterface
|
|||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$nonce = random::generatePassword(16);
|
$nonce = random::generatePassword(16);
|
||||||
$params = [':usr_id' => $row['usr_id'], ':nonce' => $nonce];
|
$params = array(':usr_id' => $row['usr_id'], ':nonce' => $nonce);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
}
|
}
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
@@ -82,10 +83,10 @@ class patch_320alpha2a implements patchInterface
|
|||||||
if (strpos($row['class'], 'task_period_') !== false)
|
if (strpos($row['class'], 'task_period_') !== false)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$params = [
|
$params = array(
|
||||||
':task_id' => $row['task_id']
|
':task_id' => $row['task_id']
|
||||||
, ':class' => str_replace('task_', 'task_period_', $row['class'])
|
, ':class' => str_replace('task_', 'task_period_', $row['class'])
|
||||||
];
|
);
|
||||||
|
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
}
|
}
|
||||||
|
@@ -11,48 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha3a implements patchInterface
|
class patch_320alpha3a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.3';
|
private $release = '3.2.0-alpha.3';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE basusr SET nowatermark=1 WHERE needwatermark=0';
|
$sql = 'UPDATE basusr SET nowatermark=1 WHERE needwatermark=0';
|
||||||
|
@@ -11,48 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha4a implements patchInterface
|
class patch_320alpha4a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.4';
|
private $release = '3.2.0-alpha.4';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'TRUNCATE metadatas';
|
$sql = 'TRUNCATE metadatas';
|
||||||
@@ -70,7 +71,7 @@ class patch_320alpha4a implements patchInterface
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$phrasea_maps = [
|
$phrasea_maps = array(
|
||||||
'pdftext' => 'Phraseanet:pdftext'
|
'pdftext' => 'Phraseanet:pdftext'
|
||||||
, 'tf-archivedate' => 'Phraseanet:tf-archivedate'
|
, 'tf-archivedate' => 'Phraseanet:tf-archivedate'
|
||||||
, 'tf-atime' => 'Phraseanet:tf-atime'
|
, 'tf-atime' => 'Phraseanet:tf-atime'
|
||||||
@@ -89,7 +90,7 @@ class patch_320alpha4a implements patchInterface
|
|||||||
, 'tf-recordid' => 'Phraseanet:tf-recordid'
|
, 'tf-recordid' => 'Phraseanet:tf-recordid'
|
||||||
, 'tf-size' => 'Phraseanet:tf-size'
|
, 'tf-size' => 'Phraseanet:tf-size'
|
||||||
, 'tf-width' => 'Phraseanet:tf-width'
|
, 'tf-width' => 'Phraseanet:tf-width'
|
||||||
];
|
);
|
||||||
|
|
||||||
$sxe = $databox->get_sxml_structure();
|
$sxe = $databox->get_sxml_structure();
|
||||||
$dom_struct = $databox->get_dom_structure();
|
$dom_struct = $databox->get_dom_structure();
|
||||||
|
@@ -15,55 +15,54 @@ use Alchemy\Phrasea\Model\Entities\FeedEntry;
|
|||||||
use Alchemy\Phrasea\Model\Entities\FeedItem;
|
use Alchemy\Phrasea\Model\Entities\FeedItem;
|
||||||
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
|
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
|
||||||
use Gedmo\Timestampable\TimestampableListener;
|
use Gedmo\Timestampable\TimestampableListener;
|
||||||
|
use Doctrine\ORM\Query\ResultSetMapping;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha4b implements patchInterface
|
class patch_320alpha4b implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.4';
|
private $release = '3.2.0-alpha.4';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('feed');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$feeds = array();
|
$feeds = array();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -120,7 +119,7 @@ class patch_320alpha4b implements patchInterface
|
|||||||
$sql = 'SELECT sselcont_id, ssel_id, base_id, record_id
|
$sql = 'SELECT sselcont_id, ssel_id, base_id, record_id
|
||||||
FROM sselcont WHERE ssel_id = :ssel_id ORDER BY ord ASC';
|
FROM sselcont WHERE ssel_id = :ssel_id ORDER BY ord ASC';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute([':ssel_id' => $row['ssel_id']]);
|
$stmt->execute(array(':ssel_id' => $row['ssel_id']));
|
||||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
@@ -143,7 +142,7 @@ class patch_320alpha4b implements patchInterface
|
|||||||
$sql = 'UPDATE ssel SET deleted = "1", migrated="1"
|
$sql = 'UPDATE ssel SET deleted = "1", migrated="1"
|
||||||
WHERE ssel_id = :ssel_id';
|
WHERE ssel_id = :ssel_id';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute([':ssel_id' => $row['ssel_id']]);
|
$stmt->execute(array(':ssel_id' => $row['ssel_id']));
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
$app['EM']->persist($feed);
|
$app['EM']->persist($feed);
|
||||||
$n++;
|
$n++;
|
||||||
@@ -171,7 +170,7 @@ class patch_320alpha4b implements patchInterface
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
protected static $feeds = [];
|
protected static $feeds = array();
|
||||||
|
|
||||||
protected function get_feed(appbox $appbox, User_Adapter $user, $pub_restrict, $homelink, Application $app)
|
protected function get_feed(appbox $appbox, User_Adapter $user, $pub_restrict, $homelink, Application $app)
|
||||||
{
|
{
|
||||||
@@ -204,9 +203,9 @@ class patch_320alpha4b implements patchInterface
|
|||||||
if ($homelink) {
|
if ($homelink) {
|
||||||
$feed->setPublic(true);
|
$feed->setPublic(true);
|
||||||
|
|
||||||
$app['EM']->persist($feed);
|
$app['EM']->persist($feed);
|
||||||
$app['EM']->persist($user);
|
$app['EM']->persist($user);
|
||||||
$app['EM']->flush();
|
$app['EM']->flush();
|
||||||
|
|
||||||
} elseif ($pub_restrict == 1) {
|
} elseif ($pub_restrict == 1) {
|
||||||
$collections = $app['acl']->get($user)->get_granted_base();
|
$collections = $app['acl']->get($user)->get_granted_base();
|
||||||
|
@@ -11,51 +11,51 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha5a implements patchInterface
|
class patch_320alpha5a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.5';
|
private $release = '3.2.0-alpha.5';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = 'SELECT base_id, usr_id FROM order_masters';
|
$sql = 'SELECT base_id, usr_id FROM order_masters';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
@@ -67,10 +67,10 @@ class patch_320alpha5a implements patchInterface
|
|||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$params = [
|
$params = array(
|
||||||
':base_id' => $row['base_id'],
|
':base_id' => $row['base_id'],
|
||||||
':usr_id' => $row['usr_id']
|
':usr_id' => $row['usr_id']
|
||||||
];
|
);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,48 +11,50 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha6a implements patchInterface
|
class patch_320alpha6a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.6';
|
private $release = '3.2.0-alpha.6';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE record r, subdef s
|
$sql = 'UPDATE record r, subdef s
|
||||||
|
@@ -11,48 +11,50 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_320alpha8a implements patchInterface
|
class patch_320alpha8a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.2.0-alpha.8';
|
private $release = '3.2.0-alpha.8';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM basusr WHERE actif = "0"';
|
$sql = 'DELETE FROM basusr WHERE actif = "0"';
|
||||||
|
@@ -13,53 +13,52 @@ use Alchemy\Phrasea\Application;
|
|||||||
use Doctrine\DBAL\Migrations\Configuration\Configuration;
|
use Doctrine\DBAL\Migrations\Configuration\Configuration;
|
||||||
use Doctrine\DBAL\DriverManager;
|
use Doctrine\DBAL\DriverManager;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_360alpha1a implements patchInterface
|
class patch_360alpha1a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.6.0-alpha.1';
|
private $release = '3.6.0-alpha.1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('workzone', 'session');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$tables = array('StoryWZ', 'ValidationDatas', 'ValidationParticipants', 'ValidationSessions', 'BasketElements', 'Baskets');
|
$tables = array('StoryWZ', 'ValidationDatas', 'ValidationParticipants', 'ValidationSessions', 'BasketElements', 'Baskets');
|
||||||
|
|
||||||
foreach ($tables as $table) {
|
foreach ($tables as $table) {
|
||||||
@@ -69,7 +68,7 @@ class patch_360alpha1a implements patchInterface
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
$stories = [];
|
$stories = array();
|
||||||
|
|
||||||
$sql = 'SELECT sbas_id, rid as record_id, usr_id
|
$sql = 'SELECT sbas_id, rid as record_id, usr_id
|
||||||
FROM ssel
|
FROM ssel
|
||||||
@@ -80,7 +79,7 @@ class patch_360alpha1a implements patchInterface
|
|||||||
$rs_s = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs_s = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$current = [];
|
$current = array();
|
||||||
|
|
||||||
foreach ($rs_s as $row_story) {
|
foreach ($rs_s as $row_story) {
|
||||||
$serial = $row_story['sbas_id'] . '_' . $row_story['usr_id'] . '_' . $row_story['record_id'];
|
$serial = $row_story['sbas_id'] . '_' . $row_story['usr_id'] . '_' . $row_story['record_id'];
|
||||||
@@ -99,11 +98,11 @@ class patch_360alpha1a implements patchInterface
|
|||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($stories as $row) {
|
foreach ($stories as $row) {
|
||||||
$params = [
|
$params = array(
|
||||||
':usr_id' => $row['usr_id'],
|
':usr_id' => $row['usr_id'],
|
||||||
':sbas_id' => $row['sbas_id'],
|
':sbas_id' => $row['sbas_id'],
|
||||||
':record_id' => $row['record_id']
|
':record_id' => $row['record_id']
|
||||||
];
|
);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +137,7 @@ class patch_360alpha1a implements patchInterface
|
|||||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$sselcont_ids = [];
|
$sselcont_ids = array();
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$sql = 'SELECT c.sselcont_id, c.record_id, b.sbas_id
|
$sql = 'SELECT c.sselcont_id, c.record_id, b.sbas_id
|
||||||
@@ -147,11 +146,11 @@ class patch_360alpha1a implements patchInterface
|
|||||||
AND c.ssel_id = :ssel_id AND s.ssel_id = c.ssel_id';
|
AND c.ssel_id = :ssel_id AND s.ssel_id = c.ssel_id';
|
||||||
|
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
$stmt->execute([':ssel_id' => $row['ssel_id']]);
|
$stmt->execute(array(':ssel_id' => $row['ssel_id']));
|
||||||
$rs_be = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs_be = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$current = [];
|
$current = array();
|
||||||
|
|
||||||
foreach ($rs_be as $row_sselcont) {
|
foreach ($rs_be as $row_sselcont) {
|
||||||
$serial = $row_sselcont['sbas_id'] . '_' . $row_sselcont['record_id'];
|
$serial = $row_sselcont['sbas_id'] . '_' . $row_sselcont['record_id'];
|
||||||
@@ -168,7 +167,7 @@ class patch_360alpha1a implements patchInterface
|
|||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($sselcont_ids as $sselcont_id) {
|
foreach ($sselcont_ids as $sselcont_id) {
|
||||||
$stmt->execute([':sselcont_id' => $sselcont_id]);
|
$stmt->execute(array(':sselcont_id' => $sselcont_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
@@ -237,11 +236,11 @@ class patch_360alpha1a implements patchInterface
|
|||||||
)';
|
)';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$params = [
|
$params = array(
|
||||||
':participant_id' => $row['participant_id'],
|
':participant_id' => $row['participant_id'],
|
||||||
':basket_id' => $row['basket_id'],
|
':basket_id' => $row['basket_id'],
|
||||||
':usr_id' => $row['usr_id'],
|
':usr_id' => $row['usr_id'],
|
||||||
];
|
);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,48 +11,50 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_360alpha1b implements patchInterface
|
class patch_360alpha1b implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.6.0-alpha.1';
|
private $release = '3.6.0-alpha.1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@@ -11,48 +11,50 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_360alpha2a implements patchInterface
|
class patch_360alpha2a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.6.0-alpha.2';
|
private $release = '3.6.0-alpha.2';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -11,48 +11,50 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_360alpha2b implements patchInterface
|
class patch_360alpha2b implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.6.0-alpha.2';
|
private $release = '3.6.0-alpha.2';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -119,7 +121,7 @@ class patch_360alpha2b implements patchInterface
|
|||||||
VALUES (null, :record_id, :meta_struct_id, :value)';
|
VALUES (null, :record_id, :meta_struct_id, :value)';
|
||||||
$stmt = $databox->get_connection()->prepare($sql);
|
$stmt = $databox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
$databox_fields = [];
|
$databox_fields = array();
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$meta_struct_id = $row['meta_struct_id'];
|
$meta_struct_id = $row['meta_struct_id'];
|
||||||
@@ -131,11 +133,11 @@ class patch_360alpha2b implements patchInterface
|
|||||||
$values = \caption_field::get_multi_values($row['value'], $databox_fields[$meta_struct_id]->get_separator());
|
$values = \caption_field::get_multi_values($row['value'], $databox_fields[$meta_struct_id]->get_separator());
|
||||||
|
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
$params = [
|
$params = array(
|
||||||
':record_id' => $row['record_id'],
|
':record_id' => $row['record_id'],
|
||||||
':meta_struct_id' => $row['meta_struct_id'],
|
':meta_struct_id' => $row['meta_struct_id'],
|
||||||
':value' => $value,
|
':value' => $value,
|
||||||
];
|
);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,7 +148,7 @@ class patch_360alpha2b implements patchInterface
|
|||||||
$stmt = $databox->get_connection()->prepare($sql);
|
$stmt = $databox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$params = [':id' => $row['id']];
|
$params = array(':id' => $row['id']);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,48 +12,50 @@
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Doctrine\ORM\Tools\Pagination\Paginator;
|
use Doctrine\ORM\Tools\Pagination\Paginator;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_361alpha1a implements patchInterface
|
class patch_361alpha1a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.6.1-alpha.1';
|
private $release = '3.6.1-alpha.1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('workzone');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
@@ -77,7 +79,7 @@ class patch_361alpha1a implements patchInterface
|
|||||||
|
|
||||||
$sql = 'SELECT record_id FROM record WHERE record_id = :record_id';
|
$sql = 'SELECT record_id FROM record WHERE record_id = :record_id';
|
||||||
$stmt = $connbas->prepare($sql);
|
$stmt = $connbas->prepare($sql);
|
||||||
$stmt->execute([':record_id' => $row['record_id']]);
|
$stmt->execute(array(':record_id' => $row['record_id']));
|
||||||
$rowCount = $stmt->rowCount();
|
$rowCount = $stmt->rowCount();
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
@@ -11,48 +11,50 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha1a implements patchInterface
|
class patch_370alpha1a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.1';
|
private $release = '3.7.0-alpha.1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$conn = $databox->get_connection();
|
$conn = $databox->get_connection();
|
||||||
@@ -84,7 +86,7 @@ class patch_370alpha1a implements patchInterface
|
|||||||
|
|
||||||
$sql = 'UPDATE pref SET value = :structure WHERE prop = "structure"';
|
$sql = 'UPDATE pref SET value = :structure WHERE prop = "structure"';
|
||||||
$stmt = $conn->prepare($sql);
|
$stmt = $conn->prepare($sql);
|
||||||
$stmt->execute([':structure' => $DOMDocument->saveXML()]);
|
$stmt->execute(array(':structure' => $DOMDocument->saveXML()));
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -12,24 +12,13 @@
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha3a implements patchInterface
|
class patch_370alpha3a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.3';
|
private $release = '3.7.0-alpha.3';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -40,20 +29,33 @@ class patch_370alpha3a implements patchInterface
|
|||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@@ -11,48 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha4a implements patchInterface
|
class patch_370alpha4a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.4';
|
private $release = '3.7.0-alpha.4';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id, src FROM metadatas_structure';
|
$sql = 'SELECT id, src FROM metadatas_structure';
|
||||||
@@ -61,7 +62,7 @@ class patch_370alpha4a implements patchInterface
|
|||||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$update = [];
|
$update = array();
|
||||||
|
|
||||||
$tagDirname = new \Alchemy\Phrasea\Metadata\Tag\TfDirname();
|
$tagDirname = new \Alchemy\Phrasea\Metadata\Tag\TfDirname();
|
||||||
$tagBasename = new \Alchemy\Phrasea\Metadata\Tag\TfBasename();
|
$tagBasename = new \Alchemy\Phrasea\Metadata\Tag\TfBasename();
|
||||||
@@ -69,10 +70,10 @@ class patch_370alpha4a implements patchInterface
|
|||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
|
|
||||||
if (strpos(strtolower($row['src']), 'tf-parentdir') !== false) {
|
if (strpos(strtolower($row['src']), 'tf-parentdir') !== false) {
|
||||||
$update[] = ['id' => $row['id'], 'src' => $tagDirname->getTagname()];
|
$update[] = array('id' => $row['id'], 'src' => $tagDirname->getTagname());
|
||||||
}
|
}
|
||||||
if (strpos(strtolower($row['src']), 'tf-filename') !== false) {
|
if (strpos(strtolower($row['src']), 'tf-filename') !== false) {
|
||||||
$update[] = ['id' => $row['id'], 'src' => $tagBasename->getTagname()];
|
$update[] = array('id' => $row['id'], 'src' => $tagBasename->getTagname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +81,7 @@ class patch_370alpha4a implements patchInterface
|
|||||||
$stmt = $databox->get_connection()->prepare($sql);
|
$stmt = $databox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($update as $row) {
|
foreach ($update as $row) {
|
||||||
$stmt->execute([':src' => $row['src'], ':id' => $row['id']]);
|
$stmt->execute(array(':src' => $row['src'], ':id' => $row['id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
@@ -11,48 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha5a implements patchInterface
|
class patch_370alpha5a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.5';
|
private $release = '3.7.0-alpha.5';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -62,20 +63,20 @@ class patch_370alpha5a implements patchInterface
|
|||||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$update = [];
|
$update = array();
|
||||||
|
|
||||||
foreach ($rs as $row) {
|
foreach ($rs as $row) {
|
||||||
$src = str_replace(
|
$src = str_replace(
|
||||||
['/rdf:RDF/rdf:Description/PHRASEANET:', '/rdf:RDF/rdf:Description/'], ['Phraseanet:', ''], $row['src']
|
array('/rdf:RDF/rdf:Description/PHRASEANET:', '/rdf:RDF/rdf:Description/'), array('Phraseanet:', ''), $row['src']
|
||||||
);
|
);
|
||||||
$update[] = ['id' => $row['id'], 'src' => $src];
|
$update[] = array('id' => $row['id'], 'src' => $src);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE metadatas_structure SET src = :src WHERE id = :id';
|
$sql = 'UPDATE metadatas_structure SET src = :src WHERE id = :id';
|
||||||
$stmt = $databox->get_connection()->prepare($sql);
|
$stmt = $databox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($update as $row) {
|
foreach ($update as $row) {
|
||||||
$stmt->execute([':src' => $row['src'], ':id' => $row['id']]);
|
$stmt->execute(array(':src' => $row['src'], ':id' => $row['id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
@@ -11,48 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha6a implements patchInterface
|
class patch_370alpha6a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.6';
|
private $release = '3.7.0-alpha.6';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$structure = $databox->get_structure();
|
$structure = $databox->get_structure();
|
||||||
@@ -80,7 +81,7 @@ class patch_370alpha6a implements patchInterface
|
|||||||
|
|
||||||
$this->addScreenDeviceOption($subdefgroups, $subdef, $groupname);
|
$this->addScreenDeviceOption($subdefgroups, $subdef, $groupname);
|
||||||
|
|
||||||
if (in_array($name, ['preview', 'thumbnail'])) {
|
if (in_array($name, array('preview', 'thumbnail'))) {
|
||||||
|
|
||||||
if ($name == 'thumbnail' || $subdef->getSubdefType()->getType() != \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO) {
|
if ($name == 'thumbnail' || $subdef->getSubdefType()->getType() != \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO) {
|
||||||
$this->addMobileSubdefImage($subdefgroups, $subdef, $groupname);
|
$this->addMobileSubdefImage($subdefgroups, $subdef, $groupname);
|
||||||
@@ -104,7 +105,7 @@ class patch_370alpha6a implements patchInterface
|
|||||||
{
|
{
|
||||||
$optionsSubdef = $subdef->getOptions();
|
$optionsSubdef = $subdef->getOptions();
|
||||||
|
|
||||||
$options = [];
|
$options = array();
|
||||||
|
|
||||||
foreach ($optionsSubdef as $optname => $option) {
|
foreach ($optionsSubdef as $optname => $option) {
|
||||||
$options[$optname] = $option->getValue();
|
$options[$optname] = $option->getValue();
|
||||||
@@ -113,19 +114,19 @@ class patch_370alpha6a implements patchInterface
|
|||||||
$options['path'] = $subdef->get_path();
|
$options['path'] = $subdef->get_path();
|
||||||
$options['mediatype'] = $subdef->getSubdefType()->getType();
|
$options['mediatype'] = $subdef->getSubdefType()->getType();
|
||||||
$options['meta'] = $subdef->meta_writeable() ? 'yes' : 'no';
|
$options['meta'] = $subdef->meta_writeable() ? 'yes' : 'no';
|
||||||
$options['devices'] = [databox_subdef::DEVICE_SCREEN];
|
$options['devices'] = array(databox_subdef::DEVICE_SCREEN);
|
||||||
|
|
||||||
$root->set_subdef($groupname, $subdef->get_name(), $subdef->get_class(), $subdef->is_downloadable(), $options, []);
|
$root->set_subdef($groupname, $subdef->get_name(), $subdef->get_class(), $subdef->is_downloadable(), $options, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addMobileSubdefVideo($root, $baseSubdef, $groupname)
|
protected function addMobileSubdefVideo($root, $baseSubdef, $groupname)
|
||||||
{
|
{
|
||||||
$newSubdefOptionsWebM = $newSubdefOptionsOgg = $newSubdefOptionsX264 = [
|
$newSubdefOptionsWebM = $newSubdefOptionsOgg = $newSubdefOptionsX264 = array(
|
||||||
'path' => $baseSubdef->get_path(),
|
'path' => $baseSubdef->get_path(),
|
||||||
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO
|
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO
|
||||||
];
|
);
|
||||||
|
|
||||||
$options = [
|
$options = array(
|
||||||
'path' => $baseSubdef->get_path(),
|
'path' => $baseSubdef->get_path(),
|
||||||
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO,
|
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO,
|
||||||
'bitrate' => '300',
|
'bitrate' => '300',
|
||||||
@@ -133,8 +134,8 @@ class patch_370alpha6a implements patchInterface
|
|||||||
'GOPsize' => '25',
|
'GOPsize' => '25',
|
||||||
'size' => '480',
|
'size' => '480',
|
||||||
'fps' => '15',
|
'fps' => '15',
|
||||||
'devices' => [databox_subdef::DEVICE_HANDHELD],
|
'devices' => array(databox_subdef::DEVICE_HANDHELD),
|
||||||
];
|
);
|
||||||
|
|
||||||
foreach ($options as $name => $value) {
|
foreach ($options as $name => $value) {
|
||||||
$newSubdefOptionsWebM[$name] = $value;
|
$newSubdefOptionsWebM[$name] = $value;
|
||||||
@@ -151,14 +152,14 @@ class patch_370alpha6a implements patchInterface
|
|||||||
$newSubdefOptionsX264['acodec'] = 'libvo_aacenc';
|
$newSubdefOptionsX264['acodec'] = 'libvo_aacenc';
|
||||||
$newSubdefOptionsX264['vcodec'] = 'libx264';
|
$newSubdefOptionsX264['vcodec'] = 'libx264';
|
||||||
|
|
||||||
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, []);
|
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, array());
|
||||||
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, []);
|
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, array());
|
||||||
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_X264', $baseSubdef->get_class(), false, $newSubdefOptionsX264, []);
|
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile_X264', $baseSubdef->get_class(), false, $newSubdefOptionsX264, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addMobileSubdefImage($root, $baseSubdef, $groupname)
|
protected function addMobileSubdefImage($root, $baseSubdef, $groupname)
|
||||||
{
|
{
|
||||||
$optionMobile = [];
|
$optionMobile = array();
|
||||||
|
|
||||||
$optionMobile['size'] = $baseSubdef->get_name() == 'thumbnail' ? '150' : '480';
|
$optionMobile['size'] = $baseSubdef->get_name() == 'thumbnail' ? '150' : '480';
|
||||||
$optionMobile['resolution'] = '72';
|
$optionMobile['resolution'] = '72';
|
||||||
@@ -168,18 +169,18 @@ class patch_370alpha6a implements patchInterface
|
|||||||
$optionMobile['mediatype'] = \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_IMAGE;
|
$optionMobile['mediatype'] = \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_IMAGE;
|
||||||
$optionMobile['meta'] = 'no';
|
$optionMobile['meta'] = 'no';
|
||||||
|
|
||||||
$optionMobile['devices'] = [databox_subdef::DEVICE_HANDHELD];
|
$optionMobile['devices'] = array(databox_subdef::DEVICE_HANDHELD);
|
||||||
|
|
||||||
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile', $baseSubdef->get_class(), false, $optionMobile, []);
|
$root->set_subdef($groupname, $baseSubdef->get_name() . '_mobile', $baseSubdef->get_class(), false, $optionMobile, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addHtml5Video($root, $baseSubdef, $groupname)
|
protected function addHtml5Video($root, $baseSubdef, $groupname)
|
||||||
{
|
{
|
||||||
$newSubdefOptionsWebM = $newSubdefOptionsOgg = [
|
$newSubdefOptionsWebM = $newSubdefOptionsOgg = array(
|
||||||
'path' => $baseSubdef->get_path(),
|
'path' => $baseSubdef->get_path(),
|
||||||
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO,
|
'mediatype' => \Alchemy\Phrasea\Media\Subdef\Subdef::TYPE_VIDEO,
|
||||||
'devices' => [\databox_subdef::DEVICE_SCREEN]
|
'devices' => array(\databox_subdef::DEVICE_SCREEN)
|
||||||
];
|
);
|
||||||
|
|
||||||
foreach ($baseSubdef->getOptions() as $optionname => $option) {
|
foreach ($baseSubdef->getOptions() as $optionname => $option) {
|
||||||
$newSubdefOptionsWebM[$optionname] = $option->getValue();
|
$newSubdefOptionsWebM[$optionname] = $option->getValue();
|
||||||
@@ -192,7 +193,7 @@ class patch_370alpha6a implements patchInterface
|
|||||||
$newSubdefOptionsOgg['vcodec'] = 'libtheora';
|
$newSubdefOptionsOgg['vcodec'] = 'libtheora';
|
||||||
$newSubdefOptionsOgg['acodec'] = 'libvorbis';
|
$newSubdefOptionsOgg['acodec'] = 'libvorbis';
|
||||||
|
|
||||||
$root->set_subdef($groupname, $baseSubdef->get_name() . '_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, []);
|
$root->set_subdef($groupname, $baseSubdef->get_name() . '_webM', $baseSubdef->get_class(), false, $newSubdefOptionsWebM, array());
|
||||||
$root->set_subdef($groupname, $baseSubdef->get_name() . '_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, []);
|
$root->set_subdef($groupname, $baseSubdef->get_name() . '_OGG', $baseSubdef->get_class(), false, $newSubdefOptionsOgg, array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,53 +15,51 @@ use Alchemy\Phrasea\Model\Entities\LazaretSession;
|
|||||||
use MediaAlchemyst\Exception\ExceptionInterface as MediaAlchemystException;
|
use MediaAlchemyst\Exception\ExceptionInterface as MediaAlchemystException;
|
||||||
use MediaAlchemyst\Specification\Image as ImageSpec;
|
use MediaAlchemyst\Specification\Image as ImageSpec;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha7a implements patchInterface
|
class patch_370alpha7a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.7';
|
private $release = '3.7.0-alpha.7';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('lazaret');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -12,48 +12,43 @@
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha8a implements patchInterface
|
class patch_370alpha8a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.8';
|
private $release = '3.7.0-alpha.8';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('task');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* transform tasks 'workflow 01' to 'RecordMover'
|
* transform tasks 'workflow 01' to 'RecordMover'
|
||||||
* will group tasks(01) with same period to a single task(02)
|
* will group tasks(01) with same period to a single task(02)
|
||||||
@@ -65,9 +60,6 @@ class patch_370alpha8a implements patchInterface
|
|||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$ttasks = array();
|
$ttasks = array();
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
$sql = 'SELECT task_id, active, name, class, settings FROM task2 WHERE class=\'task_period_workflow01\'';
|
$sql = 'SELECT task_id, active, name, class, settings FROM task2 WHERE class=\'task_period_workflow01\'';
|
||||||
@@ -77,11 +69,11 @@ class patch_370alpha8a implements patchInterface
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
$tdom = []; // key = period
|
$tdom = array(); // key = period
|
||||||
$taskstodel = [];
|
$taskstodel = array();
|
||||||
foreach ($ttasks as $task) {
|
foreach ($ttasks as $task) {
|
||||||
$active = true;
|
$active = true;
|
||||||
$warning = [];
|
$warning = array();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* migrating task 'workflow01'
|
* migrating task 'workflow01'
|
||||||
@@ -98,7 +90,7 @@ class patch_370alpha8a implements patchInterface
|
|||||||
$ts->appendChild($dom->createElement('period'))->appendChild($dom->createTextNode(60 * $period));
|
$ts->appendChild($dom->createElement('period'))->appendChild($dom->createTextNode(60 * $period));
|
||||||
$ts->appendChild($dom->createElement('logsql'))->appendChild($dom->createTextNode('1'));
|
$ts->appendChild($dom->createElement('logsql'))->appendChild($dom->createTextNode('1'));
|
||||||
$tasks = $ts->appendChild($dom->createElement('tasks'));
|
$tasks = $ts->appendChild($dom->createElement('tasks'));
|
||||||
$tdom['_' . $period] = ['dom' => $dom, 'tasks' => $tasks];
|
$tdom['_' . $period] = array('dom' => $dom, 'tasks' => $tasks);
|
||||||
} else {
|
} else {
|
||||||
$dom = &$tdom['_' . $period]['dom'];
|
$dom = &$tdom['_' . $period]['dom'];
|
||||||
$tasks = &$tdom['_' . $period]['tasks'];
|
$tasks = &$tdom['_' . $period]['tasks'];
|
||||||
|
@@ -11,42 +11,40 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_370alpha9a implements patchInterface
|
class patch_370alpha9a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.0-alpha.9';
|
private $release = '3.7.0-alpha.9';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -54,8 +52,7 @@ class patch_370alpha9a implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $appbox
|
* {@inheritdoc}
|
||||||
* @param Application $app
|
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
@@ -19,29 +19,35 @@ class patch_3715alpha1a implements patchInterface
|
|||||||
*/
|
*/
|
||||||
private $release = '3.7.15-alpha1';
|
private $release = '3.7.15-alpha1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -49,7 +55,7 @@ class patch_3715alpha1a implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $databox
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
@@ -11,42 +11,32 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_371alpha1a implements patchInterface
|
class patch_371alpha1a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.1-alpha1';
|
private $release = '3.7.1-alpha1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -54,8 +44,15 @@ class patch_371alpha1a implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $databox
|
* {@inheritdoc}
|
||||||
* @param Application $app
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
|
@@ -11,42 +11,40 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_373alpha1a implements patchInterface
|
class patch_373alpha1a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.3-alpha.1';
|
private $release = '3.7.3-alpha.1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -54,15 +52,14 @@ class patch_373alpha1a implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $appbox
|
* {@inheritdoc}
|
||||||
* @param Application $app
|
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT * FROM registry WHERE `key` = :key';
|
$sql = 'SELECT * FROM registry WHERE `key` = :key';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
|
|
||||||
$Regbinaries = [
|
$Regbinaries = array(
|
||||||
'GV_cli',
|
'GV_cli',
|
||||||
'GV_swf_extract',
|
'GV_swf_extract',
|
||||||
'GV_pdf2swf',
|
'GV_pdf2swf',
|
||||||
@@ -72,9 +69,9 @@ class patch_373alpha1a implements patchInterface
|
|||||||
'GV_ffprobe',
|
'GV_ffprobe',
|
||||||
'GV_mp4box',
|
'GV_mp4box',
|
||||||
'GV_pdftotext',
|
'GV_pdftotext',
|
||||||
];
|
);
|
||||||
|
|
||||||
$mapping = [
|
$mapping = array(
|
||||||
'GV_cli' => 'php_binary',
|
'GV_cli' => 'php_binary',
|
||||||
'GV_swf_extract' => 'swf_extract_binary',
|
'GV_swf_extract' => 'swf_extract_binary',
|
||||||
'GV_pdf2swf' => 'pdf2swf_binary',
|
'GV_pdf2swf' => 'pdf2swf_binary',
|
||||||
@@ -84,12 +81,12 @@ class patch_373alpha1a implements patchInterface
|
|||||||
'GV_ffprobe' => 'ffprobe_binary',
|
'GV_ffprobe' => 'ffprobe_binary',
|
||||||
'GV_mp4box' => 'mp4box_binary',
|
'GV_mp4box' => 'mp4box_binary',
|
||||||
'GV_pdftotext' => 'pdftotext_binary',
|
'GV_pdftotext' => 'pdftotext_binary',
|
||||||
];
|
);
|
||||||
|
|
||||||
$binaries = ['ghostscript_binary' => null];
|
$binaries = array('ghostscript_binary' => null);
|
||||||
|
|
||||||
foreach ($Regbinaries as $name) {
|
foreach ($Regbinaries as $name) {
|
||||||
$stmt->execute([':key' => $name]);
|
$stmt->execute(array(':key' => $name));
|
||||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
$value = is_executable($row['value']) ? $row['value'] : null;
|
$value = is_executable($row['value']) ? $row['value'] : null;
|
||||||
|
|
||||||
@@ -105,14 +102,14 @@ class patch_373alpha1a implements patchInterface
|
|||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
|
|
||||||
foreach ($Regbinaries as $name) {
|
foreach ($Regbinaries as $name) {
|
||||||
$stmt->execute([':key' => $name]);
|
$stmt->execute(array(':key' => $name));
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$sql = 'SELECT value FROM registry WHERE `key` = :key';
|
$sql = 'SELECT value FROM registry WHERE `key` = :key';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute([':key'=>'GV_sit']);
|
$stmt->execute(array(':key'=>'GV_sit'));
|
||||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
@@ -122,7 +119,7 @@ class patch_373alpha1a implements patchInterface
|
|||||||
|
|
||||||
$sql = 'DELETE FROM registry WHERE `key` = :key';
|
$sql = 'DELETE FROM registry WHERE `key` = :key';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute([':key'=>'GV_sit']);
|
$stmt->execute(array(':key'=>'GV_sit'));
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -13,35 +13,38 @@ use Alchemy\Phrasea\Application;
|
|||||||
|
|
||||||
class patch_379alpha1a implements patchInterface
|
class patch_379alpha1a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.7.9-alpha1';
|
private $release = '3.7.9-alpha1';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -49,8 +52,7 @@ class patch_379alpha1a implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $appbox
|
* {@inheritdoc}
|
||||||
* @param Application $app
|
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
@@ -27,6 +27,14 @@ class patch_380alpha10a implements patchInterface
|
|||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -45,14 +45,19 @@ class patch_380alpha11a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('session');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$sql = 'SELECT usr_id, user_agent, ip, platform, browser, app,
|
$sql = 'SELECT usr_id, user_agent, ip, platform, browser, app,
|
||||||
browser_version, screen, token, nonce, lastaccess, created_on
|
browser_version, screen, token, nonce, lastaccess, created_on
|
||||||
|
@@ -27,6 +27,14 @@ class patch_380alpha13a implements patchInterface
|
|||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -35,6 +35,14 @@ class patch_380alpha14a implements patchInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -27,6 +27,13 @@ class patch_380alpha15a implements patchInterface
|
|||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -27,6 +27,14 @@ class patch_380alpha16a implements patchInterface
|
|||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -27,6 +27,14 @@ class patch_380alpha17a implements patchInterface
|
|||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -28,6 +28,14 @@ class patch_380alpha18a implements patchInterface
|
|||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -11,42 +11,41 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_380alpha2a implements patchInterface
|
class patch_380alpha2a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.8.0-alpha.2';
|
private $release = '3.8.0-alpha.2';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -54,8 +53,7 @@ class patch_380alpha2a implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $databox
|
* {@inheritdoc}
|
||||||
* @param Application $app
|
|
||||||
*/
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
|
@@ -11,42 +11,41 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_380alpha2b implements patchInterface
|
class patch_380alpha2b implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.8.0-alpha.2';
|
private $release = '3.8.0-alpha.2';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -54,8 +53,7 @@ class patch_380alpha2b implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $appbox
|
* {@inheritdoc}
|
||||||
* @param Application $app
|
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
@@ -11,49 +11,49 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_380alpha3a implements patchInterface
|
class patch_380alpha3a implements patchInterface
|
||||||
{
|
{
|
||||||
/**
|
/** @var string */
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.8.0-alpha.3';
|
private $release = '3.8.0-alpha.3';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::DATA_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::DATA_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function apply(base $databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$conn = $databox->get_connection();
|
$conn = $databox->get_connection();
|
||||||
|
@@ -11,43 +11,32 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
||||||
* @link www.phraseanet.com
|
|
||||||
*/
|
|
||||||
class patch_380alpha3b implements patchInterface
|
class patch_380alpha3b implements patchInterface
|
||||||
{
|
{
|
||||||
|
/** @var string */
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private $release = '3.8.0-alpha.3';
|
private $release = '3.8.0-alpha.3';
|
||||||
|
|
||||||
/**
|
/** @var array */
|
||||||
*
|
private $concern = array(base::APPLICATION_BOX);
|
||||||
* @var Array
|
|
||||||
*/
|
|
||||||
private $concern = [base::APPLICATION_BOX];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function get_release()
|
public function get_release()
|
||||||
{
|
{
|
||||||
return $this->release;
|
return $this->release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritdoc}
|
||||||
* @return Array
|
|
||||||
*/
|
*/
|
||||||
public function concern()
|
public function concern()
|
||||||
{
|
{
|
||||||
@@ -55,8 +44,15 @@ class patch_380alpha3b implements patchInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param base $appbox
|
* {@inheritdoc}
|
||||||
* @param Application $app
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
@@ -64,5 +60,4 @@ class patch_380alpha3b implements patchInterface
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -44,14 +44,20 @@ class patch_380alpha4a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('auth-failure');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$conn = $app['phraseanet.appbox']->get_connection();
|
$conn = $app['phraseanet.appbox']->get_connection();
|
||||||
$sql = 'SELECT date, login, ip, locked FROM badlog ORDER BY id ASC';
|
$sql = 'SELECT date, login, ip, locked FROM badlog ORDER BY id ASC';
|
||||||
$stmt = $conn->prepare($sql);
|
$stmt = $conn->prepare($sql);
|
||||||
|
@@ -43,6 +43,14 @@ class patch_380alpha6a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -43,6 +43,14 @@ class patch_380alpha8a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -43,6 +43,14 @@ class patch_380alpha9a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -35,6 +35,14 @@ class patch_381alpha1a implements patchInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -35,6 +35,14 @@ class patch_381alpha1b implements patchInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -35,6 +35,14 @@ class patch_381alpha2a implements patchInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
@@ -44,14 +44,19 @@ class patch_390alpha1a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('ftp-credential');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release . 'a');
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$conn = $app['phraseanet.appbox']->get_connection();
|
$conn = $app['phraseanet.appbox']->get_connection();
|
||||||
$sql = 'SELECT usr_id, activeFTP, addrFTP, loginFTP,
|
$sql = 'SELECT usr_id, activeFTP, addrFTP, loginFTP,
|
||||||
retryFTP, passifFTP, pwdFTP, destFTP, prefixFTPfolder
|
retryFTP, passifFTP, pwdFTP, destFTP, prefixFTPfolder
|
||||||
|
@@ -35,7 +35,7 @@ class patch_390alpha1b implements patchInterface
|
|||||||
*/
|
*/
|
||||||
public function require_all_upgrades()
|
public function require_all_upgrades()
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,14 +46,19 @@ class patch_390alpha1b implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('order');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release . 'b');
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM Orders';
|
$sql = 'DELETE FROM Orders';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -46,14 +46,19 @@ class patch_390alpha2a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('user');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM Users';
|
$sql = 'DELETE FROM Users';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -44,14 +44,19 @@ class patch_390alpha3a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('user-query');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM UserQueries';
|
$sql = 'DELETE FROM UserQueries';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -44,14 +44,19 @@ class patch_390alpha4a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('user-setting');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM UserSettings';
|
$sql = 'DELETE FROM UserSettings';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -44,14 +44,19 @@ class patch_390alpha5a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('user-notif-setting');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM UserNotificationSettings';
|
$sql = 'DELETE FROM UserNotificationSettings';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -46,14 +46,19 @@ class patch_390alpha6a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('ftp-export');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM FtpExports';
|
$sql = 'DELETE FROM FtpExports';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -16,6 +16,7 @@ use Alchemy\Phrasea\Model\Entities\FeedEntry;
|
|||||||
use Alchemy\Phrasea\Model\Entities\FeedItem;
|
use Alchemy\Phrasea\Model\Entities\FeedItem;
|
||||||
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
|
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
|
||||||
use Alchemy\Phrasea\Model\Entities\FeedToken;
|
use Alchemy\Phrasea\Model\Entities\FeedToken;
|
||||||
|
use Doctrine\ORM\Query\ResultSetMapping;
|
||||||
|
|
||||||
class patch_390alpha7a implements patchInterface
|
class patch_390alpha7a implements patchInterface
|
||||||
{
|
{
|
||||||
@@ -49,13 +50,36 @@ class patch_390alpha7a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('feed', 'aggregate-token');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
$rsm = new ResultSetMapping();
|
||||||
$version->execute('up');
|
$rsm->addScalarResult('Name', 'Name');
|
||||||
|
|
||||||
|
$backup = false;
|
||||||
|
|
||||||
|
foreach ($app['EM']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
|
||||||
|
if (0 === strcmp('feeds', $row['Name'])) {
|
||||||
|
$backup = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false === $backup) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$app['EM']->executeQuery("RENAME TABLE `feeds` TO `feeds_backup`");
|
||||||
|
|
||||||
$sql = 'DELETE FROM Feeds';
|
$sql = 'DELETE FROM Feeds';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
@@ -89,22 +113,6 @@ class patch_390alpha7a implements patchInterface
|
|||||||
|
|
||||||
$conn = $app['phraseanet.appbox']->get_connection();
|
$conn = $app['phraseanet.appbox']->get_connection();
|
||||||
|
|
||||||
$sql = 'SHOW TABLE STATUS;';
|
|
||||||
$stmt = $conn->prepare($sql);
|
|
||||||
$stmt->execute();
|
|
||||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
|
||||||
|
|
||||||
$found = false;
|
|
||||||
foreach ($rs as $row) {
|
|
||||||
if ('feeds_backup' === $row['Name']) {
|
|
||||||
$found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!$found) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = 'SELECT id, title, subtitle, public, created_on, updated_on, base_id FROM feeds_backup;';
|
$sql = 'SELECT id, title, subtitle, public, created_on, updated_on, base_id FROM feeds_backup;';
|
||||||
$stmt = $conn->prepare($sql);
|
$stmt = $conn->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -44,14 +44,19 @@ class patch_390alpha8a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations()
|
||||||
|
{
|
||||||
|
return array('task');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function apply(base $appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$version = $app['doctrine-migration.configuration']->getVersion($this->release);
|
|
||||||
$version->execute('up');
|
|
||||||
|
|
||||||
$sql = 'DELETE FROM Tasks';
|
$sql = 'DELETE FROM Tasks';
|
||||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
@@ -4,12 +4,44 @@ use Alchemy\Phrasea\Application;
|
|||||||
|
|
||||||
interface patchInterface
|
interface patchInterface
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Returns the release version.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function get_release();
|
public function get_release();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the patch concerns the Application Box or
|
||||||
|
* the Data Box.
|
||||||
|
*
|
||||||
|
* It accepts base::APPLICATION_BOX or base::DATA_BOX value.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function concern();
|
public function concern();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tells whether the patch must be run after the others or not.
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public function require_all_upgrades();
|
public function require_all_upgrades();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply patch.
|
||||||
|
*
|
||||||
|
* @param base $base The Application Box or the Data Boxes where the patch is applied.
|
||||||
|
* @param Application $app
|
||||||
|
*
|
||||||
|
* @return boolean returns true if the patch succeed.
|
||||||
|
*/
|
||||||
public function apply(base $base, Application $app);
|
public function apply(base $base, Application $app);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns doctrine migrations needed for the patch.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getDoctrineMigrations();
|
||||||
}
|
}
|
||||||
|
@@ -4,47 +4,44 @@ table_name: doctrine_migration_versions
|
|||||||
|
|
||||||
migrations:
|
migrations:
|
||||||
migration1:
|
migration1:
|
||||||
version: 3.2.0-alpha.4
|
version: feed
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version320alpha4
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\FeedMigration
|
||||||
migration2:
|
migration2:
|
||||||
version: 3.6.0-alpha.1
|
version: workzone
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version360alpha1
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\WorkzoneMigration
|
||||||
migration3:
|
migration3:
|
||||||
version: 3.7.0-alpha.7
|
version: lazaret
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version370alpha7
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\LazaretMigration
|
||||||
migration4:
|
migration4:
|
||||||
version: 3.7.0-alpha.8
|
version: task
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version370alpha8
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\TaskMigration
|
||||||
migration5:
|
migration5:
|
||||||
version: 3.8.0-alpha.4
|
version: auth-failure
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version380alpha4
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\AuthFailureMigration
|
||||||
migration6:
|
migration6:
|
||||||
version: 3.8.0-alpha.11
|
version: session
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version380alpha11
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\SessionMigration
|
||||||
migration7:
|
migration7:
|
||||||
version: 3.9.0-alpha.1a
|
version: ftp-credential
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha1a
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\FtpCredentialMigration
|
||||||
migration8:
|
migration8:
|
||||||
version: 3.9.0-alpha.1b
|
version: order
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha1b
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\OrderMigration
|
||||||
migration9:
|
migration9:
|
||||||
version: 3.9.0-alpha.2
|
version: user
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha2
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\UserMigration
|
||||||
migration10:
|
migration10:
|
||||||
version: 3.9.0-alpha.3
|
version: user-query
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha3
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\UserQueryMigration
|
||||||
migration11:
|
migration11:
|
||||||
version: 3.9.0-alpha.4
|
version: user-setting
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha4
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\UserSettingMigration
|
||||||
migration12:
|
migration12:
|
||||||
version: 3.9.0-alpha.5
|
version: user-notif-setting
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha5
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\UserNotificationSettingMigration
|
||||||
migration13:
|
migration13:
|
||||||
version: 3.9.0-alpha.6
|
version: ftp-export
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha6
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\FtpExportMigration
|
||||||
migration14:
|
migration14:
|
||||||
version: 3.9.0-alpha.7
|
version: aggregate-token
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha7
|
class: Alchemy\Phrasea\Setup\DoctrineMigrations\AggregateTokenMigration
|
||||||
migration15:
|
|
||||||
version: 3.9.0-alpha.8
|
|
||||||
class: Alchemy\Phrasea\Setup\DoctrineMigrations\Version390alpha8
|
|
||||||
|
Reference in New Issue
Block a user