Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2012 08:48
Show Gist options
  • Save anonymous/4283731 to your computer and use it in GitHub Desktop.
Save anonymous/4283731 to your computer and use it in GitHub Desktop.
Flow3, Doctrine and SQLite Migrations/Sqlite/Version20121211145611.php
<?php
namespace TYPO3\FLOW3\Persistence\Doctrine\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20121211145611 extends AbstractMigration {
/**
* @param Schema $schema
* @return void
*/
public function up(Schema $schema) {
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "sqlite");
/*
$this->addSql("CREATE TABLE typo3_flow3_resource_resourcepointer (hash VARCHAR(255) NOT NULL, PRIMARY KEY("hash"))");
$this->addSql("CREATE TABLE typo3_flow3_mvc_routing_objectpathmapping (objecttype VARCHAR(255) NOT NULL, uripattern VARCHAR(255) NOT NULL, pathsegment VARCHAR(255) NOT NULL, identifier VARCHAR(255) NOT NULL, PRIMARY KEY("objecttype", "uripattern", "pathsegment"))");
$this->addSql("CREATE TABLE typo3_flow3_resource_publishing_abstractpublishingconfiguration (flow3_persistence_identifier VARCHAR(40) NOT NULL, dtype VARCHAR(255) NOT NULL, PRIMARY KEY("flow3_persistence_identifier"))");
$this->addSql("CREATE TABLE typo3_flow3_resource_resource (flow3_persistence_identifier VARCHAR(40) NOT NULL, resourcepointer VARCHAR(255) DEFAULT NULL, publishingconfiguration VARCHAR(40) DEFAULT NULL, filename VARCHAR(255) NOT NULL, fileextension VARCHAR(255) NOT NULL, PRIMARY KEY("flow3_persistence_identifier"))");
$this->addSql("CREATE INDEX IDX_B4D45B323CB65D1 ON typo3_flow3_resource_resource (resourcepointer)");
$this->addSql("CREATE INDEX IDX_B4D45B32A4A851AF ON typo3_flow3_resource_resource (publishingconfiguration)");
*/
$this->addSql("CREATE TABLE typo3_flow3_security_account (flow3_persistence_identifier VARCHAR(40) NOT NULL, party VARCHAR(40) DEFAULT NULL, accountidentifier VARCHAR(255) NOT NULL, authenticationprovidername VARCHAR(255) NOT NULL, credentialssource VARCHAR(255) DEFAULT NULL, creationdate DATETIME NOT NULL, expirationdate DATETIME DEFAULT NULL, roles CLOB NOT NULL, PRIMARY KEY('flow3_persistence_identifier'))");
$this->addSql("CREATE INDEX IDX_65EFB31C89954EE0 ON typo3_flow3_security_account (party)");
$this->addSql("CREATE UNIQUE INDEX flow3_identity_typo3_flow3_security_account ON typo3_flow3_security_account (accountidentifier, authenticationprovidername)");
$this->addSql("CREATE TABLE typo3_flow3_security_authorization_resource_securitypubli_6180a (flow3_persistence_identifier VARCHAR(40) NOT NULL, allowedroles CLOB NOT NULL, PRIMARY KEY('flow3_persistence_identifier'))");
$this->addSql("CREATE TABLE typo3_flow3_security_policy_role (identifier VARCHAR(255) NOT NULL, PRIMARY KEY('identifier'))");
$this->addSql("CREATE TABLE typo3_party_domain_model_abstractparty (flow3_persistence_identifier VARCHAR(40) NOT NULL, dtype VARCHAR(255) NOT NULL, PRIMARY KEY('flow3_persistence_identifier'))");
$this->addSql("CREATE TABLE typo3_party_domain_model_electronicaddress (flow3_persistence_identifier VARCHAR(40) NOT NULL, identifier VARCHAR(255) NOT NULL, type VARCHAR(20) NOT NULL, usagetype VARCHAR(20) DEFAULT NULL, approved BOOLEAN NOT NULL, PRIMARY KEY('flow3_persistence_identifier'))");
$this->addSql("CREATE TABLE typo3_party_domain_model_person (flow3_persistence_identifier VARCHAR(40) NOT NULL, name VARCHAR(40) DEFAULT NULL, primaryelectronicaddress VARCHAR(40) DEFAULT NULL, PRIMARY KEY('flow3_persistence_identifier'))");
$this->addSql("CREATE UNIQUE INDEX UNIQ_C60479E15E237E06 ON typo3_party_domain_model_person (name)");
$this->addSql("CREATE INDEX IDX_C60479E1A7CECF13 ON typo3_party_domain_model_person (primaryelectronicaddress)");
$this->addSql("CREATE TABLE typo3_party_domain_model_person_electronicaddresses_join (party_person VARCHAR(40) NOT NULL, party_electronicaddress VARCHAR(40) NOT NULL, PRIMARY KEY('party_person', 'party_electronicaddress'))");
$this->addSql("CREATE INDEX IDX_BE7D49F772AAAA2F ON typo3_party_domain_model_person_electronicaddresses_join (party_person)");
$this->addSql("CREATE INDEX IDX_BE7D49F7B06BD60D ON typo3_party_domain_model_person_electronicaddresses_join (party_electronicaddress)");
$this->addSql("CREATE TABLE typo3_party_domain_model_personname (flow3_persistence_identifier VARCHAR(40) NOT NULL, title VARCHAR(255) NOT NULL, firstname VARCHAR(255) NOT NULL, middlename VARCHAR(255) NOT NULL, lastname VARCHAR(255) NOT NULL, othername VARCHAR(255) NOT NULL, alias VARCHAR(255) NOT NULL, fullname VARCHAR(255) NOT NULL, PRIMARY KEY('flow3_persistence_identifier'))");
$this->addSql("CREATE TABLE my_package_name_domain_model_prototype (flow3_persistence_identifier VARCHAR(40) NOT NULL, PRIMARY KEY('flow3_persistence_identifier'))");
}
/**
* @param Schema $schema
* @return void
*/
public function down(Schema $schema) {
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "sqlite");
/*
$this->addSql("DROP TABLE typo3_flow3_resource_resourcepointer");
$this->addSql("DROP TABLE typo3_flow3_mvc_routing_objectpathmapping");
$this->addSql("DROP TABLE typo3_flow3_resource_publishing_abstractpublishingconfiguration");
$this->addSql("DROP TABLE typo3_flow3_resource_resource");
*/
$this->addSql("DROP TABLE typo3_flow3_security_account");
$this->addSql("DROP TABLE typo3_flow3_security_authorization_resource_securitypubli_6180a");
$this->addSql("DROP TABLE typo3_flow3_security_policy_role");
$this->addSql("DROP TABLE typo3_party_domain_model_abstractparty");
$this->addSql("DROP TABLE typo3_party_domain_model_electronicaddress");
$this->addSql("DROP TABLE typo3_party_domain_model_person");
$this->addSql("DROP TABLE typo3_party_domain_model_person_electronicaddresses_join");
$this->addSql("DROP TABLE typo3_party_domain_model_personname");
$this->addSql("DROP TABLE my_package_name_domain_model_prototype");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment