diff --git a/composer.json b/composer.json index a355ab0750..64c566b916 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ "symfony/validator": "^5.3.0", "symfony/var-dumper": "^5.3.0", "ibexa/doctrine-schema": "~4.6.0@dev", + "ibexa/doctrine-migrations": "~4.6.x-dev", "symfony-cmf/routing": "^2.3", "nelmio/cors-bundle": "^2.0", "pagerfanta/pagerfanta": "^2.1", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 6ac13d46c4..bc69a73939 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5550,84 +5550,12 @@ parameters: count: 1 path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - message: '#^Call to method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:checkParameters\(\) on a separate line has no effect\.$#' - identifier: method.resultUnused - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:__construct\(\) has parameter \$installers with no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:cacheClear\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:checkCreateDatabase\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:checkParameters\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:checkPermissions\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:configure\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:executeCommand\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:getInstaller\(\) has parameter \$type with no type specified\.$#' - identifier: missingType.parameter - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:getInstaller\(\) should return Ibexa\\Bundle\\RepositoryInstaller\\Installer\\Installer but returns false\.$#' - identifier: return.type - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\InstallPlatformCommand\:\:indexData\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - message: '#^Strict comparison using \=\=\= between bool and 1 will always evaluate to false\.$#' identifier: identical.alwaysFalse count: 1 path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 1 - path: src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php - - message: '#^Method Ibexa\\Bundle\\RepositoryInstaller\\Command\\ValidatePasswordHashesCommand\:\:configure\(\) has no return type specified\.$#' identifier: missingType.return diff --git a/src/bundle/Core/DependencyInjection/Configuration.php b/src/bundle/Core/DependencyInjection/Configuration.php index 4b859f673b..6082b59115 100644 --- a/src/bundle/Core/DependencyInjection/Configuration.php +++ b/src/bundle/Core/DependencyInjection/Configuration.php @@ -65,6 +65,7 @@ public function getConfigTreeBuilder() $this->addUrlWildcardsSection($rootNode); $this->addOrmSection($rootNode); $this->addUITranslationsSection($rootNode); + $this->addInstallerSection($rootNode); // Delegate SiteAccess config to configuration parsers $this->mainSiteAccessConfigParser->addSemanticConfig($this->generateScopeBaseNode($rootNode)); @@ -563,6 +564,44 @@ private function addUITranslationsSection($rootNode): ArrayNodeDefinition ->end() ->end(); } + + /** + * Defines configuration for the "ibexa:install" installer. + * + * The configuration is available at: + * + * ibexa: + * installer: + * schema_builder_event: + * enabled: true + * + * + * @param \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $rootNode + */ + private function addInstallerSection(ArrayNodeDefinition $rootNode): ArrayNodeDefinition + { + return $rootNode + ->children() + ->arrayNode('installer') + ->children() + ->arrayNode('schema_builder_event') + ->info('Configuration of the legacy, event-driven database schema building mechanism used by the "ibexa:install" command') + ->children() + ->booleanNode('enabled') + ->defaultTrue() + ->info( + 'Whether "ibexa:install" dispatches Ibexa\Contracts\DoctrineSchema\Event\SchemaBuilderEvent ' . + 'to let packages contribute their database schema via an event subscriber, as opposed to ' . + 'the schema being installed from static SQL migrations. ' . + 'Disable once all installed packages have migrated away from the event-driven mechanism.' + ) + ->end() + ->end() + ->end() + ->end() + ->end() + ->end(); + } } class_alias(Configuration::class, 'eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration'); diff --git a/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php b/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php index 5c8fda3ec1..450a4df7e6 100644 --- a/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php +++ b/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php @@ -118,6 +118,8 @@ public function load(array $configs, ContainerBuilder $container) // Base services and services overrides $loader->load('services.yml'); + // Doctrine Migrations for core's own schema, alongside the legacy SchemaBuilderEvent path + $loader->load('doctrine_migrations.yml'); // Security services $loader->load('security.yml'); // HTTP Kernel @@ -134,6 +136,7 @@ public function load(array $configs, ContainerBuilder $container) $this->registerUrlWildcardsConfiguration($config, $container); $this->registerOrmConfiguration($config, $container); $this->registerUITranslationsConfiguration($config, $container); + $this->registerInstallerConfiguration($config, $container); // Routing $this->handleRouting($config, $container, $loader); @@ -331,6 +334,17 @@ private function registerUITranslationsConfiguration(array $config, ContainerBui $container->setParameter('ibexa.ui.translations.enabled', $config['ui']['translations']['enabled'] ?? false); } + /** + * @param array $config + */ + private function registerInstallerConfiguration(array $config, ContainerBuilder $container): void + { + $container->setParameter( + 'ibexa.installer.schema_builder_event.enabled', + $config['installer']['schema_builder_event']['enabled'] ?? true + ); + } + /** * Handle routing parameters. * diff --git a/src/bundle/Core/Resources/config/doctrine_migrations.yml b/src/bundle/Core/Resources/config/doctrine_migrations.yml new file mode 100644 index 0000000000..78ab3f7026 --- /dev/null +++ b/src/bundle/Core/Resources/config/doctrine_migrations.yml @@ -0,0 +1,24 @@ +services: + Ibexa\Bundle\RepositoryInstaller\Migration\InstallSchemaMigration: + autowire: true + public: false + arguments: + $connection: '@ibexa.persistence.connection' + tags: + - { name: !php/const Ibexa\Contracts\DoctrineMigrations\Migrations\IbexaMigrationTag::TAG } + + Ibexa\Bundle\RepositoryInstaller\Migration\AddUrlAliasMlLinkIndexMigration: + autowire: true + public: false + arguments: + $connection: '@ibexa.persistence.connection' + tags: + - { name: !php/const Ibexa\Contracts\DoctrineMigrations\Migrations\IbexaMigrationTag::TAG } + + Ibexa\Bundle\RepositoryInstaller\Migration\ImportDataMigration: + autowire: true + public: false + arguments: + $connection: '@ibexa.persistence.connection' + tags: + - { name: !php/const Ibexa\Contracts\DoctrineMigrations\Migrations\IbexaMigrationTag::TAG } diff --git a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php index 0011d9d37c..567f33680a 100644 --- a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php +++ b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php @@ -9,6 +9,7 @@ use Doctrine\DBAL\Connection; use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider; use Ibexa\Bundle\Core\Command\BackwardCompatibleCommand; +use Ibexa\Bundle\RepositoryInstaller\Installer\Installer; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; @@ -17,28 +18,25 @@ use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; final class InstallPlatformCommand extends Command implements BackwardCompatibleCommand { - /** @var \Doctrine\DBAL\Connection */ - private $connection; + protected static $defaultName = 'ibexa:install'; - /** @var \Symfony\Component\Console\Output\OutputInterface */ - private $output; + private Connection $connection; - /** @var \Psr\Cache\CacheItemPoolInterface */ - private $cachePool; + private OutputInterface $output; - /** @var string */ - private $environment; + private CacheItemPoolInterface $cachePool; - /** @var \Ibexa\Bundle\RepositoryInstaller\Installer\Installer[] */ - private $installers = []; + private string $environment; - /** @var \Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider */ - private $repositoryConfigurationProvider; + private ServiceLocator $installers; + + private RepositoryConfigurationProvider $repositoryConfigurationProvider; public const EXIT_GENERAL_DATABASE_ERROR = 4; public const EXIT_PARAMETERS_NOT_FOUND = 5; @@ -47,7 +45,7 @@ final class InstallPlatformCommand extends Command implements BackwardCompatible public function __construct( Connection $connection, - array $installers, + ServiceLocator $installers, CacheItemPoolInterface $cachePool, string $environment, RepositoryConfigurationProvider $repositoryConfigurationProvider @@ -60,14 +58,13 @@ public function __construct( parent::__construct(); } - protected function configure() + protected function configure(): void { - $this->setName('ibexa:install'); $this->setAliases($this->getDeprecatedAliases()); $this->addArgument( 'type', InputArgument::OPTIONAL, - 'The type of install. Available options: ' . implode(', ', array_keys($this->installers)), + 'The type of install. Available options: ' . implode(', ', array_keys($this->installers->getProvidedServices())), 'ibexa-oss' ); $this->addOption( @@ -82,43 +79,35 @@ protected function execute(InputInterface $input, OutputInterface $output): int { $this->output = $output; $this->checkPermissions(); - $this->checkParameters(); $this->checkCreateDatabase($output); $schemaManager = $this->connection->getSchemaManager(); if (!empty($schemaManager->listTables())) { $io = new SymfonyStyle($input, $output); if (!$io->confirm('Running this command will delete data in all Ibexa generated tables. Continue?', )) { - return 0; + return self::SUCCESS; } } $type = $input->getArgument('type'); $siteaccess = $input->getOption('siteaccess'); - $installer = $this->getInstaller($type); - if ($installer === false) { - $output->writeln( - "Unknown install type '$type', available options in currently installed Ibexa package: " . - implode(', ', array_keys($this->installers)) - ); - exit(self::EXIT_UNKNOWN_INSTALL_TYPE); - } + $installer = $this->getInstaller($type, $output); $installer->setOutput($output); $installer->importSchema(); $installer->importData(); $installer->importBinaries(); - $this->cacheClear($output); + $this->cacheClear(); if (!$input->getOption('skip-indexing')) { $this->indexData($output, $siteaccess); } - return 0; + return self::SUCCESS; } - private function checkPermissions() + private function checkPermissions(): void { // @todo should take var-dir etc. from composer config or fallback to flex directory scheme if (!is_writable('public') && !is_writable('public/var')) { @@ -127,18 +116,7 @@ private function checkPermissions() } } - private function checkParameters() - { - // @todo doesn't make sense to check for parameters.yml in sf4 and flex - return; - $parametersFile = 'app/config/parameters.yml'; - if (!is_file($parametersFile)) { - $this->output->writeln("Required configuration file '$parametersFile' not found"); - exit(self::EXIT_PARAMETERS_NOT_FOUND); - } - } - - private function checkCreateDatabase(OutputInterface $output) + private function checkCreateDatabase(OutputInterface $output): void { $output->writeln( sprintf( @@ -167,10 +145,8 @@ private function checkCreateDatabase(OutputInterface $output) /** * Clear all content related cache (persistence cache). - * - * @param \Symfony\Component\Console\Output\OutputInterface $output */ - private function cacheClear(OutputInterface $output) + private function cacheClear(): void { $this->cachePool->clear(); } @@ -183,11 +159,8 @@ private function cacheClear(OutputInterface $output) * This is done after cache clearing to make sure no cached data from before sql import is used. * * IMPORTANT: This is done using a command because config has change, so container and all services are different. - * - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @param string|null $siteaccess */ - private function indexData(OutputInterface $output, $siteaccess = null) + private function indexData(OutputInterface $output, ?string $siteaccess = null): void { $output->writeln( sprintf('Search engine re-indexing, executing command ibexa:reindex') @@ -202,17 +175,19 @@ private function indexData(OutputInterface $output, $siteaccess = null) } /** - * @param $type - * * @return \Ibexa\Bundle\RepositoryInstaller\Installer\Installer */ - private function getInstaller($type) + private function getInstaller(string $type, OutputInterface $output): Installer { - if (!isset($this->installers[$type])) { - return false; + if (!$this->installers->has($type)) { + $output->writeln( + "Unknown install type '$type', available options in currently installed Ibexa package: " . + implode(', ', array_keys($this->installers->getProvidedServices())) + ); + exit(self::EXIT_UNKNOWN_INSTALL_TYPE); } - return $this->installers[$type]; + return $this->installers->get($type); } /** @@ -227,7 +202,7 @@ private function getInstaller($type) * Escape any user provided arguments, like: 'assets:install '.escapeshellarg($webDir) * @param int $timeout */ - private function executeCommand(OutputInterface $output, $cmd, $timeout = 300) + private function executeCommand(OutputInterface $output, $cmd, $timeout = 300): void { $phpFinder = new PhpExecutableFinder(); if (!$phpPath = $phpFinder->find(false)) { diff --git a/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.php b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.php index cf0df72c3e..bb8acf0ebc 100644 --- a/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.php +++ b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPass.php @@ -6,46 +6,22 @@ */ namespace Ibexa\Bundle\RepositoryInstaller\DependencyInjection\Compiler; -use Ibexa\Bundle\RepositoryInstaller\Command\InstallPlatformCommand; -use LogicException; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; /** - * Injects services tagged as "ibexa.installer" into - * {@see \Ibexa\Bundle\RepositoryInstaller\Command\InstallPlatformCommand::$installers}. + * @deprecated 4.6.27 Installers are now injected into + * {@see \Ibexa\Bundle\RepositoryInstaller\Command\InstallPlatformCommand::$installers} via a + * `!tagged_locator` argument configured in services.yml, so this compiler pass is no longer needed. + * Will be removed in 5.0. */ class InstallerTagPass implements CompilerPassInterface { + /** @deprecated 4.6.27 Will be removed in 6.0. Use the 'ibexa.installer' string directly. */ public const INSTALLER_TAG = 'ibexa.installer'; public function process(ContainerBuilder $container) { - if (!$container->hasDefinition(InstallPlatformCommand::class)) { - return; - } - - $installCommandDef = $container->findDefinition(InstallPlatformCommand::class); - $installers = []; - - foreach ($container->findTaggedServiceIds(self::INSTALLER_TAG) as $id => $tags) { - foreach ($tags as $tag) { - if (!isset($tag['type'])) { - throw new LogicException( - sprintf( - 'Service tag %s needs a "type" attribute to identify the installer. You need to provide a tag for %s.', - self::INSTALLER_TAG, - $id - ) - ); - } - - $installers[$tag['type']] = new Reference($id); - } - } - - $installCommandDef->replaceArgument('$installers', $installers); } } diff --git a/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/RegisterSchemaBuilderEventSchemaProviderPass.php b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/RegisterSchemaBuilderEventSchemaProviderPass.php new file mode 100644 index 0000000000..47fadc4add --- /dev/null +++ b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/RegisterSchemaBuilderEventSchemaProviderPass.php @@ -0,0 +1,41 @@ +hasDefinition(IbexaOnlyDependencyFactory::SERVICE_ID) + || !$container->hasDefinition(SchemaBuilderEventSchemaProvider::class) + ) { + return; + } + + $container->getDefinition(IbexaOnlyDependencyFactory::SERVICE_ID) + ->addMethodCall('setService', [SchemaProvider::class, new Reference(SchemaBuilderEventSchemaProvider::class)]); + } +} diff --git a/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/RemoveTaggedMigrationsRunnerPass.php b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/RemoveTaggedMigrationsRunnerPass.php new file mode 100644 index 0000000000..90468208d3 --- /dev/null +++ b/src/bundle/RepositoryInstaller/DependencyInjection/Compiler/RemoveTaggedMigrationsRunnerPass.php @@ -0,0 +1,38 @@ +hasDefinition(IbexaOnlyDependencyFactory::SERVICE_ID)) { + return; + } + + if ($container->hasDefinition(TaggedMigrationsRunner::class)) { + $container->removeDefinition(TaggedMigrationsRunner::class); + } + } +} diff --git a/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.php b/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.php index b5934d8080..727671450e 100644 --- a/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.php +++ b/src/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundle.php @@ -7,7 +7,8 @@ namespace Ibexa\Bundle\RepositoryInstaller; use Ibexa\Bundle\DoctrineSchema\DoctrineSchemaBundle; -use Ibexa\Bundle\RepositoryInstaller\DependencyInjection\Compiler\InstallerTagPass; +use Ibexa\Bundle\RepositoryInstaller\DependencyInjection\Compiler\RegisterSchemaBuilderEventSchemaProviderPass; +use Ibexa\Bundle\RepositoryInstaller\DependencyInjection\Compiler\RemoveTaggedMigrationsRunnerPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\HttpKernel\Bundle\Bundle; @@ -29,7 +30,8 @@ public function build(ContainerBuilder $container) } parent::build($container); - $container->addCompilerPass(new InstallerTagPass()); + $container->addCompilerPass(new RegisterSchemaBuilderEventSchemaProviderPass()); + $container->addCompilerPass(new RemoveTaggedMigrationsRunnerPass()); } } diff --git a/src/bundle/RepositoryInstaller/Installer/CoreInstaller.php b/src/bundle/RepositoryInstaller/Installer/CoreInstaller.php index 6b05899ffe..57253f09b5 100644 --- a/src/bundle/RepositoryInstaller/Installer/CoreInstaller.php +++ b/src/bundle/RepositoryInstaller/Installer/CoreInstaller.php @@ -11,63 +11,137 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\Query\Query; +use Ibexa\Bundle\RepositoryInstaller\Migration\TaggedMigrationsRunner; +use Ibexa\Contracts\DoctrineMigrations\Migrations\IbexaOnlyDependencyFactory; use Ibexa\Contracts\DoctrineSchema\Builder\SchemaBuilderInterface; +use RuntimeException; use Symfony\Component\Console\Helper\ProgressBar; /** - * Installer which uses SchemaBuilder. + * Installer which creates the core database schema. */ class CoreInstaller extends DbBasedInstaller implements Installer { /** @var \Ibexa\Contracts\DoctrineSchema\Builder\SchemaBuilderInterface */ protected $schemaBuilder; + private bool $schemaBuilderEventEnabled; + + private ?TaggedMigrationsRunner $taggedMigrationsRunner; + + public function __construct( + Connection $db, + SchemaBuilderInterface $schemaBuilder, + bool $schemaBuilderEventEnabled, + ?TaggedMigrationsRunner $taggedMigrationsRunner = null + ) { + parent::__construct($db); + + $this->schemaBuilder = $schemaBuilder; + $this->schemaBuilderEventEnabled = $schemaBuilderEventEnabled; + $this->taggedMigrationsRunner = $taggedMigrationsRunner; + } + /** - * @param \Doctrine\DBAL\Connection $db - * @param \Ibexa\Contracts\DoctrineSchema\Builder\SchemaBuilderInterface $schemaBuilder + * Imports the core database schema. + * + * When the "ibexa.installer.schema_builder_event.enabled" setting is enabled (the default), the schema + * is built by dispatching the legacy event-driven {@see \Ibexa\Contracts\DoctrineSchema\Event\SchemaBuilderEvent}, + * allowing other packages to contribute their own tables via an event subscriber. + * + * Otherwise, the schema is installed by {@see TaggedMigrationsRunner}, which runs every not-yet-executed + * migration tagged with {@see \Ibexa\Contracts\DoctrineMigrations\Migrations\IbexaMigrationTag::TAG} + * (core's own {@see \Ibexa\Bundle\RepositoryInstaller\Migration\InstallSchemaMigration} plus any other + * package's) via the application's Doctrine Migrations DependencyFactory. + * + * @throws \Doctrine\DBAL\DBALException + * @throws \RuntimeException if "ibexa.installer.schema_builder_event.enabled" is disabled but + * "ibexa/doctrine-migrations" isn't installed/enabled to run the migrations-based path instead */ - public function __construct(Connection $db, SchemaBuilderInterface $schemaBuilder) + public function importSchema() { - parent::__construct($db); + if ($this->schemaBuilderEventEnabled) { + $this->executeQueries($this->getQueriesFromSchemaBuilderEvent()); - $this->schemaBuilder = $schemaBuilder; + return; + } + + if ($this->taggedMigrationsRunner === null) { + throw new RuntimeException( + 'Disabling "ibexa.installer.schema_builder_event.enabled" requires the "' . + IbexaOnlyDependencyFactory::SERVICE_ID . '" service (provided by "ibexa/doctrine-migrations", ' . + 'with Ibexa\Bundle\DoctrineMigrations\IbexaDoctrineMigrationsBundle registered) to be available.' + ); + } + + $this->reportExecutedQueries($this->taggedMigrationsRunner->run()); } /** - * Import Schema using event-driven Schema Builder API from Ibexa DoctrineSchema Bundle. + * Builds the schema using the event-driven Schema Builder API from the Ibexa DoctrineSchema bundle. * - * If you wish to extend schema, implement your own EventSubscriber + * If you wish to extend the schema, implement your own EventSubscriber. * * @see \Ibexa\Contracts\DoctrineSchema\Event\SchemaBuilderEvent * @see \Ibexa\Bundle\RepositoryInstaller\Event\Subscriber\BuildSchemaSubscriber * - * @throws \Doctrine\DBAL\DBALException + * @return list<\Doctrine\Migrations\Query\Query> */ - public function importSchema() + private function getQueriesFromSchemaBuilderEvent(): array { - // note: schema is built using Schema Builder event-driven API $schema = $this->schemaBuilder->buildSchema(); $databasePlatform = $this->db->getDatabasePlatform(); - $queries = array_merge( + + $sqls = array_merge( $this->getDropSqlStatementsForExistingSchema($schema, $databasePlatform), - // generate schema DDL queries $schema->toSql($databasePlatform) ); + return array_map( + static fn (string $sql): Query => new Query($sql), + $sqls, + [] + ); + } + + /** + * Reports the queries {@see TaggedMigrationsRunner} already executed (and recorded) via the Doctrine + * Migrations DependencyFactory. + * + * @param \Doctrine\Migrations\Query\Query[] $queries + */ + private function reportExecutedQueries(array $queries): void + { + $this->output->writeln( + sprintf( + 'Executed %d queries on database %s (%s)', + count($queries), + $this->db->getDatabase(), + $this->db->getDatabasePlatform()->getName() + ) + ); + } + + /** + * @param \Doctrine\Migrations\Query\Query[] $queries + */ + private function executeQueries(array $queries): void + { $queriesCount = count($queries); $this->output->writeln( sprintf( 'Executing %d queries on database %s (%s)', $queriesCount, $this->db->getDatabase(), - $databasePlatform->getName() + $this->db->getDatabasePlatform()->getName() ) ); $progressBar = new ProgressBar($this->output); $progressBar->start($queriesCount); foreach ($queries as $query) { - $this->db->exec($query); + $this->db->executeStatement($query->getStatement(), $query->getParameters(), $query->getTypes()); $progressBar->advance(1); } @@ -79,19 +153,26 @@ public function importSchema() } /** + * Imports the core bootstrap data. + * + * When the "ibexa.installer.schema_builder_event.enabled" setting is enabled (the default), this imports + * the DBMS-specific "cleandata.sql" file directly. + * + * Otherwise, this is a no-op: {@see \Ibexa\Bundle\RepositoryInstaller\Migration\ImportDataMigration} is + * tagged and already runs as part of {@see importSchema()}'s call to {@see TaggedMigrationsRunner}. + * * @throws \Doctrine\DBAL\DBALException * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException */ public function importData() { - $this->runQueriesFromFile($this->getKernelSQLFileForDBMS('cleandata.sql')); + if ($this->schemaBuilderEventEnabled) { + $this->runQueriesFromFile($this->getKernelSQLFileForDBMS('cleandata.sql')); + } } /** - * @param \Doctrine\DBAL\Schema\Schema $newSchema - * @param \Doctrine\DBAL\Platforms\AbstractPlatform $databasePlatform - * - * @return string[] + * @return list */ protected function getDropSqlStatementsForExistingSchema( Schema $newSchema, diff --git a/src/bundle/RepositoryInstaller/Migration/AddUrlAliasMlLinkIndexMigration.php b/src/bundle/RepositoryInstaller/Migration/AddUrlAliasMlLinkIndexMigration.php new file mode 100644 index 0000000000..0451419d8e --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/AddUrlAliasMlLinkIndexMigration.php @@ -0,0 +1,57 @@ +abortIfUnsupportedPlatform(SqlPlatform::MYSQL, SqlPlatform::POSTGRESQL, SqlPlatform::SQLITE); + + if (!$schema->hasTable('ezurlalias_ml') || $schema->getTable('ezurlalias_ml')->hasIndex('ezurlalias_ml_link')) { + return; + } + + if ($this->isMySQL()) { + $this->addSqlFile(__DIR__ . '/sql/add-urlalias-ml-link-index-mysql.sql'); + } elseif ($this->isPostgreSQL()) { + $this->addSqlFile(__DIR__ . '/sql/add-urlalias-ml-link-index-postgresql.sql'); + } elseif ($this->isSqlite()) { + $this->addSqlFile(__DIR__ . '/sql/add-urlalias-ml-link-index-sqlite.sql'); + } + } +} diff --git a/src/bundle/RepositoryInstaller/Migration/ImportDataMigration.php b/src/bundle/RepositoryInstaller/Migration/ImportDataMigration.php new file mode 100644 index 0000000000..be7c1565d0 --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/ImportDataMigration.php @@ -0,0 +1,62 @@ +abortIfUnsupportedPlatform(SqlPlatform::MYSQL, SqlPlatform::POSTGRESQL, SqlPlatform::SQLITE); + + // This migration inserts into "ezcontentobject" (the pre-rename name) since it runs + // before the 5.0.0 rename. Migrations execute in a strict, deterministic order, so if + // that table is missing here, this system never went through this migration at all -- + // it built its schema (and presumably its own bootstrap data) via schema.yaml directly, + // straight to the final "ibexa_content" naming. + // Two different "already done" signals, since "ezcontentobject" behaves + // differently depending on the branch: on 5.0/6.0 it's renamed away to + // "ibexa_content", so its outright absence means a legacy install already skipped + // straight to that final name. On 4.6 it's the table's real, permanent name (never + // renamed), so it always exists once the baseline has run -- there, only the actual + // bootstrap row (the root content object always has id = 1) distinguishes "not yet + // imported" from "already imported". + if (!$schema->hasTable('ezcontentobject') || $this->connection->fetchOne('SELECT 1 FROM ezcontentobject WHERE id = 1') !== false) { + return; + } + + if ($this->isMySQL()) { + $this->addSqlFile(__DIR__ . '/sql/import-data-mysql.sql'); + } elseif ($this->isPostgreSQL()) { + $this->addSqlFile(__DIR__ . '/sql/import-data-postgresql.sql'); + } elseif ($this->isSqlite()) { + $this->addSqlFile(__DIR__ . '/sql/import-data-sqlite.sql'); + } + } +} diff --git a/src/bundle/RepositoryInstaller/Migration/InstallSchemaMigration.php b/src/bundle/RepositoryInstaller/Migration/InstallSchemaMigration.php new file mode 100644 index 0000000000..fc7d0b875a --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/InstallSchemaMigration.php @@ -0,0 +1,54 @@ +abortIfUnsupportedPlatform(SqlPlatform::MYSQL, SqlPlatform::POSTGRESQL, SqlPlatform::SQLITE); + + // Checks the final, post-rename table name (not "ezcontentobject", which this + // migration creates): an install that built its schema via schema.yaml (rather than + // through this migration) never has "ezcontentobject" -- it already has + // "ibexa_content" directly. + if ($schema->hasTable('ezcontentobject')) { + return; + } + + if ($this->isMySQL()) { + $this->addSqlFile(__DIR__ . '/sql/install-schema-mysql.sql'); + } elseif ($this->isPostgreSQL()) { + $this->addSqlFile(__DIR__ . '/sql/install-schema-postgresql.sql'); + } elseif ($this->isSqlite()) { + $this->addSqlFile(__DIR__ . '/sql/install-schema-sqlite.sql'); + } + } +} diff --git a/src/bundle/RepositoryInstaller/Migration/SchemaBuilderEventSchemaProvider.php b/src/bundle/RepositoryInstaller/Migration/SchemaBuilderEventSchemaProvider.php new file mode 100644 index 0000000000..6e4811d1cf --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/SchemaBuilderEventSchemaProvider.php @@ -0,0 +1,37 @@ +schemaBuilder = $schemaBuilder; + } + + public function createSchema(): Schema + { + return $this->schemaBuilder->buildSchema(); + } +} diff --git a/src/bundle/RepositoryInstaller/Migration/TaggedMigrationsRunner.php b/src/bundle/RepositoryInstaller/Migration/TaggedMigrationsRunner.php new file mode 100644 index 0000000000..198bb88e35 --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/TaggedMigrationsRunner.php @@ -0,0 +1,111 @@ +dependencyFactory = $dependencyFactory; + } + + /** + * @return \Doctrine\Migrations\Query\Query[] All SQL statements that were executed, across all migrations run + */ + public function run(): array + { + $metadataStorage = $this->dependencyFactory->getMetadataStorage(); + // Mirrors what the "doctrine:migrations:migrate" console command does before migrating. + $metadataStorage->ensureInitialized(); + + $planCalculator = $this->dependencyFactory->getMigrationPlanCalculator(); + // getMigrations() returns an already-sorted list; its last item is the "latest" version. + $availableMigrations = $planCalculator->getMigrations()->getItems(); + if ($availableMigrations === []) { + return []; + } + + $latestVersion = end($availableMigrations)->getVersion(); + $plan = $planCalculator->getPlanUntilVersion($latestVersion); + + $connection = $this->dependencyFactory->getConnection(); + + $executedQueries = []; + foreach ($plan->getItems() as $migrationPlan) { + foreach ($this->executeMigration($connection, $metadataStorage, $migrationPlan) as $query) { + $executedQueries[] = $query; + } + } + + return $executedQueries; + } + + /** + * @return \Doctrine\Migrations\Query\Query[] + */ + private function executeMigration( + Connection $connection, + MetadataStorage $metadataStorage, + MigrationPlan $migrationPlan + ): array { + $executedAt = new DateTimeImmutable(); + + $migration = $migrationPlan->getMigration(); + // A freshly-constructed, empty Schema() would make every hasTable()/getTable() guard + // check inside a migration see nothing at all, regardless of what previous migrations + // in this same run (or a prior run) actually created -- introspect the live database + // instead, same as what "doctrine:migrations:migrate" itself does via + // DBALSchemaDiffProvider::createFromSchema(). + $migration->up($connection->getSchemaManager()->createSchema()); + $queries = $migration->getSql(); + + foreach ($queries as $query) { + $connection->executeStatement($query->getStatement(), $query->getParameters(), $query->getTypes()); + } + + $result = new ExecutionResult($migrationPlan->getVersion(), $migrationPlan->getDirection(), $executedAt); + $metadataStorage->complete($result); + + return $queries; + } +} diff --git a/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-mysql.sql b/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-mysql.sql new file mode 100644 index 0000000000..474d0a11dc --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-mysql.sql @@ -0,0 +1 @@ +ALTER TABLE ezurlalias_ml ADD INDEX ezurlalias_ml_link (link); diff --git a/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-postgresql.sql b/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-postgresql.sql new file mode 100644 index 0000000000..34117d2b9c --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-postgresql.sql @@ -0,0 +1 @@ +CREATE INDEX IF NOT EXISTS ezurlalias_ml_link ON ezurlalias_ml (link); diff --git a/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-sqlite.sql b/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-sqlite.sql new file mode 100644 index 0000000000..34117d2b9c --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/add-urlalias-ml-link-index-sqlite.sql @@ -0,0 +1 @@ +CREATE INDEX IF NOT EXISTS ezurlalias_ml_link ON ezurlalias_ml (link); diff --git a/src/bundle/RepositoryInstaller/Migration/sql/import-data-mysql.sql b/src/bundle/RepositoryInstaller/Migration/sql/import-data-mysql.sql new file mode 100644 index 0000000000..81b1803b4c --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/import-data-mysql.sql @@ -0,0 +1,304 @@ +INSERT INTO `ezcobj_state` (`default_language_id`, `group_id`, `id`, `identifier`, `language_mask`, `priority`) +VALUES (2, 2, 1, 'not_locked', 3, 0), + (2, 2, 2, 'locked', 3, 1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_group` (`default_language_id`, `id`, `identifier`, `language_mask`) +VALUES (2,2,'ez_lock',3); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_group_language` (`contentobject_state_group_id`, `description`, `language_id`, `name`, `real_language_id`) +VALUES (2,'',3,'Lock',2); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_language` (`contentobject_state_id`, `description`, `language_id`, `name`) +VALUES (1,'',3,'Not locked'), + (2,'',3,'Locked'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_link` (`contentobject_id`, `contentobject_state_id`) +VALUES (1, 1), + (4, 1), + (10, 1), + (11, 1), + (12, 1), + (13, 1), + (14, 1), + (41, 1), + (42, 1), + (49, 1), + (50, 1), + (51, 1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontent_language` (`disabled`, `id`, `locale`, `name`) +VALUES (0, 2, 'eng-GB', 'English (United Kingdom)'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass` (`always_available`, `contentobject_name`, `created`, `creator_id`, `id`, `identifier`, `initial_language_id`, `is_container`, `language_mask`, `modified`, `modifier_id`, `remote_id`, `serialized_description_list`, `serialized_name_list`, `sort_field`, `sort_order`, `url_alias_name`, `version`) +VALUES (1,'',1024392098,14,1,'folder',2,1,2,1448831672,14,'a3d405b81be900468eb153d774f4f0d2','a:0:{}','a:1:{s:6:\"eng-GB\";s:6:\"Folder\";}',1,1,NULL,0), + (0,'',1024392098,14,2,'article',2,1,3,1082454989,14,'c15b600eb9198b1924063b5a68758232',NULL,'a:2:{s:6:\"eng-GB\";s:7:\"Article\";s:16:\"always-available\";s:6:\"eng-GB\";}',1,1,NULL,0), + (1,'',1024392098,14,3,'user_group',2,1,3,1048494743,14,'25b4268cdcd01921b808a0d854b877ef',NULL,'a:2:{s:6:\"eng-GB\";s:10:\"User group\";s:16:\"always-available\";s:6:\"eng-GB\";}',1,1,NULL,0), + (1,' ',1024392098,14,4,'user',2,0,3,1082018364,14,'40faa822edc579b02c25f6bb7beec3ad',NULL,'a:2:{s:6:\"eng-GB\";s:4:\"User\";s:16:\"always-available\";s:6:\"eng-GB\";}',1,1,NULL,0), + (1,'',1031484992,14,5,'image',2,0,3,1048494784,14,'f6df12aa74e36230eb675f364fccd25a',NULL,'a:2:{s:6:\"eng-GB\";s:5:\"Image\";s:16:\"always-available\";s:6:\"eng-GB\";}',1,1,NULL,0), + (1,'',1052385472,14,12,'file',2,0,3,1052385669,14,'637d58bfddf164627bdfd265733280a0',NULL,'a:2:{s:6:\"eng-GB\";s:4:\"File\";s:16:\"always-available\";s:6:\"eng-GB\";}',1,1,NULL,0); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass_attribute` (`can_translate`, `category`, `contentclass_id`, `data_float1`, `data_float2`, `data_float3`, `data_float4`, `data_int1`, `data_int2`, `data_int3`, `data_int4`, `data_text1`, `data_text2`, `data_text3`, `data_text4`, `data_text5`, `data_type_string`, `id`, `identifier`, `is_information_collector`, `is_required`, `is_searchable`, `is_thumbnail`, `placement`, `serialized_data_text`, `serialized_description_list`, `serialized_name_list`, `version`) +VALUES (1,'',2,0,0,0,0,255,0,0,0,'New article','','','','','ezstring',1,'title',0,1,1,1,0,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:5:\"Title\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',1,NULL,NULL,NULL,NULL,255,0,NULL,NULL,'Folder',NULL,NULL,NULL,NULL,'ezstring',4,'name',0,1,1,0,1,'N;','a:0:{}','a:1:{s:6:\"eng-GB\";s:4:\"Name\";}',0), + (1,'',3,0,0,0,0,255,0,0,0,'','','','',NULL,'ezstring',6,'name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:4:\"Name\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',3,0,0,0,0,255,0,0,0,'','','','',NULL,'ezstring',7,'description',0,0,1,0,2,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:11:\"Description\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',4,0,0,0,0,255,0,0,0,'','','','','','ezstring',8,'first_name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:10:\"First name\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',4,0,0,0,0,255,0,0,0,'','','','','','ezstring',9,'last_name',0,1,1,0,2,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:9:\"Last name\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (0,'',4,0,0,0,0,7,10,0,0,'','^[^@]+$','','','','ezuser',12,'user_account',0,1,0,0,3,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:12:\"User account\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',5,0,0,0,0,150,0,0,0,'','','','',NULL,'ezstring',116,'name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:4:\"Name\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',5,0,0,0,0,10,0,0,0,'','','','',NULL,'ezrichtext',117,'caption',0,0,1,0,2,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:7:\"Caption\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',5,10.0,0,0,0,0,0,0,0,'MB','','','',NULL,'ezimage',118,'image',0,0,1,1,3,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:5:\"Image\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',1,NULL,NULL,NULL,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezrichtext',119,'short_description',0,0,1,0,3,'N;','a:0:{}','a:1:{s:6:\"eng-GB\";s:17:\"Short description\";}',0), + (1,'',2,0,0,0,0,10,0,0,0,'','','','','','ezrichtext',120,'intro',0,1,1,0,4,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:5:\"Intro\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',2,0,0,0,0,20,0,0,0,'','','','','','ezrichtext',121,'body',0,0,1,0,5,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:4:\"Body\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (0,'',2,0,0,0,0,0,0,0,0,'','','','','','ezboolean',123,'enable_comments',0,0,0,0,6,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:15:\"Enable comments\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',12,0,0,0,0,0,0,0,0,'New file','','','',NULL,'ezstring',146,'name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:4:\"Name\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',12,0,0,0,0,10,0,0,0,'','','','',NULL,'ezrichtext',147,'description',0,0,1,0,2,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:11:\"Description\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',12,0,0,0,0,0,0,0,0,'','','','',NULL,'ezbinaryfile',148,'file',0,1,0,0,3,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:4:\"File\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',2,0,0,0,0,255,0,0,0,'','','','','','ezstring',152,'short_title',0,0,1,0,2,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:11:\"Short title\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',2,0,0,0,0,1,0,0,0,'','','','','','ezauthor',153,'author',0,0,0,0,3,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:6:\"Author\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',2,0,0,0,0,0,0,0,0,'','','','','','ezobjectrelation',154,'image',0,0,1,0,7,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:5:\"Image\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',1,NULL,NULL,NULL,NULL,100,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezstring',155,'short_name',0,0,1,0,2,'N;','a:0:{}','a:1:{s:6:\"eng-GB\";s:10:\"Short name\";}',0), + (1,'',1,NULL,NULL,NULL,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezrichtext',156,'description',0,0,1,0,4,'N;','a:0:{}','a:1:{s:6:\"eng-GB\";s:11:\"Description\";}',0), + (1,'',4,0,0,0,0,10,0,0,0,'','','','','','eztext',179,'signature',0,0,1,0,4,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:9:\"Signature\";s:16:\"always-available\";s:6:\"eng-GB\";}',0), + (1,'',4,10.0,0,0,0,0,0,0,0,'MB','','','','','ezimage',180,'image',0,0,0,1,5,NULL,NULL,'a:2:{s:6:\"eng-GB\";s:5:\"Image\";s:16:\"always-available\";s:6:\"eng-GB\";}',0); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass_classgroup` (`contentclass_id`, `contentclass_version`, `group_id`, `group_name`) +VALUES (1, 0, 1, 'Content'), + (2, 0, 1, 'Content'), + (3, 0, 2, 'Users'), + (4, 0, 2, 'Users'), + (5, 0, 3, 'Media'), + (12, 0, 3, 'Media'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass_name` (`contentclass_id`, `contentclass_version`, `language_id`, `language_locale`, `name`) +VALUES (1, 0, 2, 'eng-GB', 'Folder'), + (2, 0, 3, 'eng-GB', 'Article'), + (3, 0, 3, 'eng-GB', 'User group'), + (4, 0, 3, 'eng-GB', 'User'), + (5, 0, 3, 'eng-GB', 'Image'), + (12, 0, 3, 'eng-GB', 'File'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclassgroup` (`created`, `creator_id`, `id`, `modified`, `modifier_id`, `name`) +VALUES (1031216928, 14, 1, 1033922106, 14, 'Content'), + (1031216941, 14, 2, 1033922113, 14, 'Users'), + (1032009743, 14, 3, 1033922120, 14, 'Media'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject` (`contentclass_id`, `current_version`, `id`, `initial_language_id`, `language_mask`, `modified`, `name`, `owner_id`, `published`, `remote_id`, `section_id`, `status`) +VALUES (1,9,1,2,3,1448889046,'Ibexa Platform',14,1448889046,'9459d3c29e15006e45197295722c7ade',1,1), + (3,1,4,2,3,1033917596,'Users',14,1033917596,'f5c88a2209584891056f987fd965b0ba',2,1), + (4,2,10,2,3,1072180405,'Anonymous User',14,1033920665,'faaeb9be3bd98ed09f606fc16d144eca',2,1), + (3,1,11,2,3,1033920746,'Guest accounts',14,1033920746,'5f7f0bdb3381d6a461d8c29ff53d908f',2,1), + (3,1,12,2,3,1033920775,'Administrator users',14,1033920775,'9b47a45624b023b1a76c73b74d704acf',2,1), + (3,1,13,2,3,1033920794,'Editors',14,1033920794,'3c160cca19fb135f83bd02d911f04db2',2,1), + (4,3,14,2,3,1301062024,'Administrator User',14,1033920830,'1bb4fe25487f05527efa8bfd394cecc7',2,1), + (1,1,41,2,3,1060695457,'Media',14,1060695457,'a6e35cbcb7cd6ae4b691f3eee30cd262',3,1), + (3,1,42,2,3,1072180330,'Anonymous users',14,1072180330,'15b256dbea2ae72418ff5facc999e8f9',2,1), + (1,1,49,2,3,1080220197,'Images',14,1080220197,'e7ff633c6b8e0fd3531e74c6e712bead',3,1), + (1,1,50,2,3,1080220220,'Files',14,1080220220,'732a5acd01b51a6fe6eab448ad4138a9',3,1), + (1,1,51,2,3,1080220233,'Multimedia',14,1080220233,'09082deb98662a104f325aaa8c4933d3',3,1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_attribute` (`attribute_original_id`, `contentclassattribute_id`, `contentobject_id`, `data_float`, `data_int`, `data_text`, `data_type_string`, `id`, `language_code`, `language_id`, `sort_key_int`, `sort_key_string`, `version`) +VALUES (0,4,1,NULL,NULL,'Ibexa Platform','ezstring',1,'eng-GB',3,0,'ibexa platform',9), + (0,119,1,NULL,NULL,'
You are now ready to start your project.
','ezrichtext',2,'eng-GB',3,0,'',9), + (0,7,4,NULL,NULL,'Main group','ezstring',7,'eng-GB',3,0,'',1), + (0,6,4,NULL,NULL,'Users','ezstring',8,'eng-GB',3,0,'',1), + (0,8,10,0,0,'Anonymous','ezstring',19,'eng-GB',3,0,'anonymous',2), + (0,9,10,0,0,'User','ezstring',20,'eng-GB',3,0,'user',2), + (0,12,10,0,0,'','ezuser',21,'eng-GB',3,0,'',2), + (0,6,11,0,0,'Guest accounts','ezstring',22,'eng-GB',3,0,'',1), + (0,7,11,0,0,'','ezstring',23,'eng-GB',3,0,'',1), + (0,6,12,0,0,'Administrator users','ezstring',24,'eng-GB',3,0,'',1), + (0,7,12,0,0,'','ezstring',25,'eng-GB',3,0,'',1), + (0,6,13,0,0,'Editors','ezstring',26,'eng-GB',3,0,'',1), + (0,7,13,0,0,'','ezstring',27,'eng-GB',3,0,'',1), + (0,8,14,0,0,'Administrator','ezstring',28,'eng-GB',3,0,'administrator',3), + (0,9,14,0,0,'User','ezstring',29,'eng-GB',3,0,'user',3), + (30,12,14,0,0,'','ezuser',30,'eng-GB',3,0,'',3), + (0,4,41,0,0,'Media','ezstring',98,'eng-GB',3,0,'',1), + (0,119,41,0,1045487555,'\n
\n','ezrichtext',99,'eng-GB',3,0,'',1), + (0,6,42,0,0,'Anonymous users','ezstring',100,'eng-GB',3,0,'anonymous users',1), + (0,7,42,0,0,'User group for the anonymous user','ezstring',101,'eng-GB',3,0,'user group for the anonymous user',1), + (0,155,1,NULL,NULL,'Ibexa Platform','ezstring',102,'eng-GB',3,0,'ibexa platform',9), + (0,155,41,0,0,'','ezstring',103,'eng-GB',3,0,'',1), + (0,156,1,NULL,NULL,'
This is the clean installation coming with Ibexa Platform.It''s a bare-bones setup of the Platform, an excellent foundation to build upon if you want to start your project from scratch.
','ezrichtext',104,'eng-GB',3,0,'',9), + (0,156,41,0,1045487555,'\n
\n','ezrichtext',105,'eng-GB',3,0,'',1), + (0,4,49,0,0,'Images','ezstring',142,'eng-GB',3,0,'images',1), + (0,155,49,0,0,'','ezstring',143,'eng-GB',3,0,'',1), + (0,119,49,0,1045487555,'\n
\n','ezrichtext',144,'eng-GB',3,0,'',1), + (0,156,49,0,1045487555,'\n
\n','ezrichtext',145,'eng-GB',3,0,'',1), + (0,4,50,0,0,'Files','ezstring',147,'eng-GB',3,0,'files',1), + (0,155,50,0,0,'','ezstring',148,'eng-GB',3,0,'',1), + (0,119,50,0,1045487555,'\n
\n','ezrichtext',149,'eng-GB',3,0,'',1), + (0,156,50,0,1045487555,'\n
\n','ezrichtext',150,'eng-GB',3,0,'',1), + (0,4,51,0,0,'Multimedia','ezstring',152,'eng-GB',3,0,'multimedia',1), + (0,155,51,0,0,'','ezstring',153,'eng-GB',3,0,'',1), + (0,119,51,0,1045487555,'\n
\n','ezrichtext',154,'eng-GB',3,0,'',1), + (0,156,51,0,1045487555,'\n
\n','ezrichtext',155,'eng-GB',3,0,'',1), + (0,179,10,0,0,'','eztext',177,'eng-GB',3,0,'',2), + (0,179,14,0,0,'','eztext',178,'eng-GB',3,0,'',3), + (0,180,10,0,0,'','ezimage',179,'eng-GB',3,0,'',2), + (0,180,14,0,0,'\n\n','ezimage',180,'eng-GB',3,0,'',3); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_name` (`content_translation`, `content_version`, `contentobject_id`, `language_id`, `name`, `real_translation`) +VALUES ('eng-GB',9,1,2,'Ibexa Platform','eng-GB'), + ('eng-GB',1,4,3,'Users','eng-GB'), + ('eng-GB',2,10,3,'Anonymous User','eng-GB'), + ('eng-GB',1,11,3,'Guest accounts','eng-GB'), + ('eng-GB',1,12,3,'Administrator users','eng-GB'), + ('eng-GB',1,13,3,'Editors','eng-GB'), + ('eng-GB',3,14,3,'Administrator User','eng-GB'), + ('eng-GB',1,41,3,'Media','eng-GB'), + ('eng-GB',1,42,3,'Anonymous users','eng-GB'), + ('eng-GB',1,49,3,'Images','eng-GB'), + ('eng-GB',1,50,3,'Files','eng-GB'), + ('eng-GB',1,51,3,'Multimedia','eng-GB'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_tree` (`contentobject_id`, `contentobject_is_published`, `contentobject_version`, `depth`, `is_hidden`, `is_invisible`, `main_node_id`, `modified_subnode`, `node_id`, `parent_node_id`, `path_identification_string`, `path_string`, `priority`, `remote_id`, `sort_field`, `sort_order`) +VALUES (0,1,1,0,0,0,1,1448999778,1,1,'','/1/',0,'629709ba256fe317c3ddcee35453a96a',1,1), + (1,1,9,1,0,0,2,1301073466,2,1,'node_2','/1/2/',0,'f3e90596361e31d496d4026eb624c983',8,1), + (4,1,1,1,0,0,5,1301062024,5,1,'users','/1/5/',0,'3f6d92f8044aed134f32153517850f5a',1,1), + (11,1,1,2,0,0,12,1081860719,12,5,'users/guest_accounts','/1/5/12/',0,'602dcf84765e56b7f999eaafd3821dd3',1,1), + (12,1,1,2,0,0,13,1301062024,13,5,'users/administrator_users','/1/5/13/',0,'769380b7aa94541679167eab817ca893',1,1), + (13,1,1,2,0,0,14,1081860719,14,5,'users/editors','/1/5/14/',0,'f7dda2854fc68f7c8455d9cb14bd04a9',1,1), + (14,1,3,3,0,0,15,1301062024,15,13,'users/administrator_users/administrator_user','/1/5/13/15/',0,'e5161a99f733200b9ed4e80f9c16187b',1,1), + (41,1,1,1,0,0,43,1081860720,43,1,'media','/1/43/',0,'75c715a51699d2d309a924eca6a95145',9,1), + (42,1,1,2,0,0,44,1081860719,44,5,'users/anonymous_users','/1/5/44/',0,'4fdf0072da953bb276c0c7e0141c5c9b',9,1), + (10,1,2,3,0,0,45,1081860719,45,44,'users/anonymous_users/anonymous_user','/1/5/44/45/',0,'2cf8343bee7b482bab82b269d8fecd76',9,1), + (49,1,1,2,0,0,51,1081860720,51,43,'media/images','/1/43/51/',0,'1b26c0454b09bb49dfb1b9190ffd67cb',9,1), + (50,1,1,2,0,0,52,1081860720,52,43,'media/files','/1/43/52/',0,'0b113a208f7890f9ad3c24444ff5988c',9,1), + (51,1,1,2,0,0,53,1081860720,53,43,'media/multimedia','/1/43/53/',0,'4f18b82c75f10aad476cae5adf98c11f',9,1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_version` (`contentobject_id`, `created`, `creator_id`, `id`, `initial_language_id`, `language_mask`, `modified`, `status`, `user_id`, `version`, `workflow_event_pos`) +VALUES (4,0,14,4,2,3,0,1,0,1,1), + (11,1033920737,14,439,2,3,1033920746,1,0,1,0), + (12,1033920760,14,440,2,3,1033920775,1,0,1,0), + (13,1033920786,14,441,2,3,1033920794,1,0,1,0), + (41,1060695450,14,472,2,3,1060695457,1,0,1,0), + (42,1072180278,14,473,2,3,1072180330,1,0,1,0), + (10,1072180337,14,474,2,3,1072180405,1,0,2,0), + (49,1080220181,14,488,2,3,1080220197,1,0,1,0), + (50,1080220211,14,489,2,3,1080220220,1,0,1,0), + (51,1080220225,14,490,2,3,1080220233,1,0,1,0), + (14,1301061783,14,499,2,3,1301062024,1,0,3,0), + (1,1448889045,14,506,2,3,1448889046,1,0,9,0); +-- ibexa:sql-statement-separator +INSERT INTO `eznode_assignment` (`contentobject_id`, `contentobject_version`, `from_node_id`, `id`, `is_main`, `op_code`, `parent_node`, `parent_remote_id`, `remote_id`, `sort_field`, `sort_order`, `priority`, `is_hidden`) +VALUES (8,2,0,4,1,2,5,'','0',1,1,0,0), + (42,1,0,5,1,2,5,'','0',9,1,0,0), + (10,2,-1,6,1,2,44,'','0',9,1,0,0), + (4,1,0,7,1,2,1,'','0',1,1,0,0), + (12,1,0,8,1,2,5,'','0',1,1,0,0), + (13,1,0,9,1,2,5,'','0',1,1,0,0), + (41,1,0,11,1,2,1,'','0',1,1,0,0), + (11,1,0,12,1,2,5,'','0',1,1,0,0), + (49,1,0,27,1,2,43,'','0',9,1,0,0), + (50,1,0,28,1,2,43,'','0',9,1,0,0), + (51,1,0,29,1,2,43,'','0',9,1,0,0), + (14,3,-1,38,1,2,13,'','0',1,1,0,0); +-- ibexa:sql-statement-separator +INSERT INTO `ezpolicy` (`function_name`, `id`, `module_name`, `original_id`, `role_id`) +VALUES ('*',317,'content',0,3), + ('login',319,'user',0,3), + ('read',328,'content',0,1), + ('login',331,'user',0,1), + ('*',332,'*',0,2), + ('read',333,'content',0,4), + ('view_embed',334,'content',0,1), + ('*',340,'url',0,3); +-- ibexa:sql-statement-separator +INSERT INTO `ezpolicy_limitation` (`id`, `identifier`, `policy_id`) +VALUES (251,'Section',328), + (252,'Section',329), + (253,'SiteAccess',331), + (254,'Class',333), + (255,'Owner',333), + (256,'Class',334); +-- ibexa:sql-statement-separator +INSERT INTO `ezpolicy_limitation_value` (`id`, `limitation_id`, `value`) +VALUES (477,251,'1'), + (478,252,'1'), + (479,253,'1766001124'), + (480,254,'4'), + (481,255,'1'), + (482,256,'5'), + (483,256,'12'); +-- ibexa:sql-statement-separator +INSERT INTO `ezrole` (`id`, `is_new`, `name`, `value`, `version`) +VALUES (1,0,'Anonymous','',0), + (2,0,'Administrator','0',0), + (3,0,'Editor','',0), + (4,0,'Member','',0); +-- ibexa:sql-statement-separator +INSERT INTO `ezsection` (`id`, `identifier`, `locale`, `name`, `navigation_part_identifier`) +VALUES (1,'standard','','Standard','ezcontentnavigationpart'), + (2,'users','','Users','ezusernavigationpart'), + (3,'media','','Media','ezmedianavigationpart'); +-- ibexa:sql-statement-separator +INSERT INTO `ezsite_data` (`name`, `value`) +VALUES ('ibexa-release','4.6'); +-- ibexa:sql-statement-separator +INSERT INTO `ezurlalias` (`destination_url`, `forward_to_id`, `id`, `is_imported`, `is_internal`, `is_wildcard`, `source_md5`, `source_url`) +VALUES ('content/view/full/2',0,12,1,1,0,'d41d8cd98f00b204e9800998ecf8427e',''), + ('content/view/full/5',0,13,1,1,0,'9bc65c2abec141778ffaa729489f3e87','users'), + ('content/view/full/12',0,15,1,1,0,'02d4e844e3a660857a3f81585995ffe1','users/guest_accounts'), + ('content/view/full/13',0,16,1,1,0,'1b1d79c16700fd6003ea7be233e754ba','users/administrator_users'), + ('content/view/full/14',0,17,1,1,0,'0bb9dd665c96bbc1cf36b79180786dea','users/editors'), + ('content/view/full/15',0,18,1,1,0,'f1305ac5f327a19b451d82719e0c3f5d','users/administrator_users/administrator_user'), + ('content/view/full/43',0,20,1,1,0,'62933a2951ef01f4eafd9bdf4d3cd2f0','media'), + ('content/view/full/44',0,21,1,1,0,'3ae1aac958e1c82013689d917d34967a','users/anonymous_users'), + ('content/view/full/45',0,22,1,1,0,'aad93975f09371695ba08292fd9698db','users/anonymous_users/anonymous_user'), + ('content/view/full/51',0,28,1,1,0,'38985339d4a5aadfc41ab292b4527046','media/images'), + ('content/view/full/52',0,29,1,1,0,'ad5a8c6f6aac3b1b9df267fe22e7aef6','media/files'), + ('content/view/full/53',0,30,1,1,0,'562a0ac498571c6c3529173184a2657c','media/multimedia'); +-- ibexa:sql-statement-separator +INSERT INTO `ezurlalias_ml` (`action`, `action_type`, `alias_redirects`, `id`, `is_alias`, `is_original`, `lang_mask`, `link`, `parent`, `text`, `text_md5`) +VALUES ('nop:','nop',1,17,0,0,1,17,0,'media2','50e2736330de124f6edea9b008556fe6'), + ('eznode:43','eznode',1,9,0,1,3,9,0,'Media','62933a2951ef01f4eafd9bdf4d3cd2f0'), + ('nop:','nop',1,3,0,0,1,3,0,'users2','86425c35a33507d479f71ade53a669aa'), + ('eznode:5','eznode',1,2,0,1,3,2,0,'Users','9bc65c2abec141778ffaa729489f3e87'), + ('eznode:2','eznode',1,1,0,1,3,1,0,'','d41d8cd98f00b204e9800998ecf8427e'), + ('eznode:14','eznode',1,6,0,1,3,6,2,'Editors','a147e136bfa717592f2bd70bd4b53b17'), + ('eznode:44','eznode',1,10,0,1,3,10,2,'Anonymous-Users','c2803c3fa1b0b5423237b4e018cae755'), + ('eznode:12','eznode',1,4,0,1,3,4,2,'Guest-accounts','e57843d836e3af8ab611fde9e2139b3a'), + ('eznode:13','eznode',1,5,0,1,3,5,2,'Administrator-users','f89fad7f8a3abc8c09e1deb46a420007'), + ('nop:','nop',1,11,0,0,1,11,3,'anonymous_users2','505e93077a6dde9034ad97a14ab022b1'), + ('eznode:12','eznode',1,26,0,0,1,4,3,'guest_accounts','70bb992820e73638731aa8de79b3329e'), + ('eznode:14','eznode',1,29,0,0,1,6,3,'editors','a147e136bfa717592f2bd70bd4b53b17'), + ('nop:','nop',1,7,0,0,1,7,3,'administrator_users2','a7da338c20bf65f9f789c87296379c2a'), + ('eznode:13','eznode',1,27,0,0,1,5,3,'administrator_users','aeb8609aa933b0899aa012c71139c58c'), + ('eznode:44','eznode',1,30,0,0,1,10,3,'anonymous_users','e9e5ad0c05ee1a43715572e5cc545926'), + ('eznode:15','eznode',1,8,0,1,3,8,5,'Administrator-User','5a9d7b0ec93173ef4fedee023209cb61'), + ('eznode:15','eznode',1,28,0,0,0,8,7,'administrator_user','a3cca2de936df1e2f805710399989971'), + ('eznode:53','eznode',1,20,0,1,3,20,9,'Multimedia','2e5bc8831f7ae6a29530e7f1bbf2de9c'), + ('eznode:52','eznode',1,19,0,1,3,19,9,'Files','45b963397aa40d4a0063e0d85e4fe7a1'), + ('eznode:51','eznode',1,18,0,1,3,18,9,'Images','59b514174bffe4ae402b3d63aad79fe0'), + ('eznode:45','eznode',1,12,0,1,3,12,10,'Anonymous-User','ccb62ebca03a31272430bc414bd5cd5b'), + ('eznode:45','eznode',1,31,0,0,1,12,11,'anonymous_user','c593ec85293ecb0e02d50d4c5c6c20eb'), + ('eznode:53','eznode',1,34,0,0,1,20,17,'multimedia','2e5bc8831f7ae6a29530e7f1bbf2de9c'), + ('eznode:52','eznode',1,33,0,0,1,19,17,'files','45b963397aa40d4a0063e0d85e4fe7a1'), + ('eznode:51','eznode',1,32,0,0,1,18,17,'images','59b514174bffe4ae402b3d63aad79fe0'); +-- ibexa:sql-statement-separator +INSERT INTO `ezurlalias_ml_incr` (`id`) +VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15), (16), (17), + (18), (19), (20), (21), (22), (24), (25), (26), (27), (28), (29), (30), (31), (32), (33), + (34), (35), (36), (37); +-- ibexa:sql-statement-separator +INSERT INTO `ezuser` (`contentobject_id`, `email`, `login`, `password_hash`, `password_hash_type`) +VALUES (10,'anonymous@link.invalid','anonymous','$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',7), + (14,'admin@link.invalid','admin','$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',7); +-- ibexa:sql-statement-separator +INSERT INTO `ezuser_role` (`contentobject_id`, `id`, `limit_identifier`, `limit_value`, `role_id`) +VALUES (11,28,'','',1), + (42,31,'','',1), + (13,32,'Subtree','/1/2/',3), + (13,33,'Subtree','/1/43/',3), + (12,34,'','',2), + (13,35,'','',4); +-- ibexa:sql-statement-separator +INSERT INTO `ezuser_setting` (`is_enabled`, `max_login`, `user_id`) +VALUES (1,1000,10), + (1,10,14); +-- ibexa:sql-statement-separator +INSERT INTO `ezpreferences` (`name`, `user_id`, `value`) +SELECT 'focus_mode', u.contentobject_id, '0' FROM `ezuser` u WHERE u.login = 'admin'; diff --git a/src/bundle/RepositoryInstaller/Migration/sql/import-data-postgresql.sql b/src/bundle/RepositoryInstaller/Migration/sql/import-data-postgresql.sql new file mode 100644 index 0000000000..493f01209e --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/import-data-postgresql.sql @@ -0,0 +1,367 @@ +INSERT INTO "ezcobj_state" ("default_language_id", "group_id", "id", "identifier", "language_mask", "priority") +VALUES (2, 2, 1, 'not_locked', 3, 0), + (2, 2, 2, 'locked', 3, 1); +-- ibexa:sql-statement-separator +INSERT INTO "ezcobj_state_group" ("default_language_id", "id", "identifier", "language_mask") +VALUES (2, 2, 'ez_lock', 3); +-- ibexa:sql-statement-separator +INSERT INTO "ezcobj_state_group_language" ("contentobject_state_group_id", "description","language_id", "name", "real_language_id") +VALUES (2, '', 3, 'Lock', 2); +-- ibexa:sql-statement-separator +INSERT INTO "ezcobj_state_language" ("contentobject_state_id", "description", "language_id", "name") +VALUES (1,'',3,'Not locked'), + (2,'',3,'Locked'); +-- ibexa:sql-statement-separator +INSERT INTO "ezcobj_state_link" ("contentobject_id", "contentobject_state_id") +VALUES ( 1, 1), + ( 4, 1), + (10, 1), + (11, 1), + (12, 1), + (13, 1), + (14, 1), + (41, 1), + (42, 1), + (49, 1), + (50, 1), + (51, 1); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontent_language" ("disabled", "id", "locale", "name") +VALUES (0, 2, 'eng-GB', 'English (United Kingdom)'); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentclass" ("always_available", "contentobject_name", "created", "creator_id", "id", "identifier", "initial_language_id", "is_container", "language_mask", "modified", "modifier_id", "remote_id", "serialized_description_list", "serialized_name_list", "sort_field", "sort_order", "url_alias_name", "version") +VALUES (1,'',1024392098,14,1,'folder',2,1,2,1448831672,14,'a3d405b81be900468eb153d774f4f0d2','a:0:{}','a:1:{s:6:"eng-GB";s:6:"Folder";}',1,1,NULL,0), + (0,'',1024392098,14,2,'article',2,1,3,1082454989,14,'c15b600eb9198b1924063b5a68758232',NULL,'a:2:{s:6:"eng-GB";s:7:"Article";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,'',1024392098,14,3,'user_group',2,1,3,1048494743,14,'25b4268cdcd01921b808a0d854b877ef',NULL,'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,' ',1024392098,14,4,'user',2,0,3,1082018364,14,'40faa822edc579b02c25f6bb7beec3ad',NULL,'a:2:{s:6:"eng-GB";s:4:"User";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,'',1031484992,14,5,'image',2,0,3,1048494784,14,'f6df12aa74e36230eb675f364fccd25a',NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,'',1052385472,14,12,'file',2,0,3,1052385669,14,'637d58bfddf164627bdfd265733280a0',NULL,'a:2:{s:6:"eng-GB";s:4:"File";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentclass_attribute" ("can_translate", "category", "contentclass_id", "data_float1", "data_float2", "data_float3", "data_float4", "data_int1", "data_int2", "data_int3", "data_int4", "data_text1", "data_text2", "data_text3", "data_text4", "data_text5", "data_type_string", "id", "identifier", "is_information_collector", "is_required", "is_searchable", "is_thumbnail", "placement", "serialized_data_text", "serialized_description_list", "serialized_name_list", "version") +VALUES (1,'',2,0,0,0,0,255,0,0,0,'New article','','','','','ezstring',1,'title',0,1,1,FALSE,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Title";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',1,NULL,NULL,NULL,NULL,255,0,NULL,NULL,'Folder',NULL,NULL,NULL,NULL,'ezstring',4,'name',0,1,1,FALSE,1,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:4:"Name";}',0), + (1,'',3,0,0,0,0,255,0,0,0,'','','','',NULL,'ezstring',6,'name',0,1,1,FALSE,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',3,0,0,0,0,255,0,0,0,'','','','',NULL,'ezstring',7,'description',0,0,1,FALSE,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:11:"Description";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',4,0,0,0,0,255,0,0,0,'','','','','','ezstring',8,'first_name',0,1,1,FALSE,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:10:"First name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',4,0,0,0,0,255,0,0,0,'','','','','','ezstring',9,'last_name',0,1,1,FALSE,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:9:"Last name";s:16:"always-available";s:6:"eng-GB";}',0), + (0,'',4,0,0,0,0,7,10,0,0,'','^[^@]+$','','','','ezuser',12,'user_account',0,1,0,FALSE,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:12:"User account";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',5,0,0,0,0,150,0,0,0,'','','','',NULL,'ezstring',116,'name',0,1,1,FALSE,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',5,0,0,0,0,10,0,0,0,'','','','',NULL,'ezrichtext',117,'caption',0,0,1,FALSE,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:7:"Caption";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',5,10.0,0,0,0,0,0,0,0,'MB','','','',NULL,'ezimage',118,'image',0,0,1,TRUE,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',1,NULL,NULL,NULL,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezrichtext',119,'short_description',0,0,1,FALSE,3,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:17:"Short description";}',0), + (1,'',2,0,0,0,0,10,0,0,0,'','','','','','ezrichtext',120,'intro',0,1,1,FALSE,4,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Intro";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,20,0,0,0,'','','','','','ezrichtext',121,'body',0,0,1,FALSE,5,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Body";s:16:"always-available";s:6:"eng-GB";}',0), + (0,'',2,0,0,0,0,0,0,0,0,'','','','','','ezboolean',123,'enable_comments',0,0,0,FALSE,6,NULL,NULL,'a:2:{s:6:"eng-GB";s:15:"Enable comments";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',12,0,0,0,0,0,0,0,0,'New file','','','',NULL,'ezstring',146,'name',0,1,1,FALSE,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',12,0,0,0,0,10,0,0,0,'','','','',NULL,'ezrichtext',147,'description',0,0,1,FALSE,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:11:"Description";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',12,0,0,0,0,0,0,0,0,'','','','',NULL,'ezbinaryfile',148,'file',0,1,0,FALSE,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"File";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,255,0,0,0,'','','','','','ezstring',152,'short_title',0,0,1,FALSE,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:11:"Short title";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,1,0,0,0,'','','','','','ezauthor',153,'author',0,0,0,FALSE,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:6:"Author";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,0,0,0,0,'','','','','','ezobjectrelation',154,'image',0,0,1,FALSE,7,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',1,NULL,NULL,NULL,NULL,100,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezstring',155,'short_name',0,0,1,FALSE,2,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:10:"Short name";}',0), + (1,'',1,NULL,NULL,NULL,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezrichtext',156,'description',0,0,1,FALSE,4,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:11:"Description";}',0), + (1,'',4,0,0,0,0,10,0,0,0,'','','','','','eztext',179,'signature',0,0,1,FALSE,4,NULL,NULL,'a:2:{s:6:"eng-GB";s:9:"Signature";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',4,10.0,0,0,0,0,0,0,0,'MB','','','','','ezimage',180,'image',0,0,0,TRUE,5,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',0); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentclass_classgroup" ("contentclass_id", "contentclass_version", "group_id", "group_name") +VALUES (1,0,1,'Content'), + (2,0,1,'Content'), + (3,0,2,'Users'), + (4,0,2,'Users'), + (5,0,3,'Media'), + (12,0,3,'Media'); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentclass_name" ("contentclass_id", "contentclass_version", "language_id", "language_locale", "name") +VALUES (1,0,2,'eng-GB','Folder'), + (2,0,3,'eng-GB','Article'), + (3,0,3,'eng-GB','User group'), + (4,0,3,'eng-GB','User'), + (5,0,3,'eng-GB','Image'), + (12,0,3,'eng-GB','File'); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentclassgroup" ("created", "creator_id", "id", "modified", "modifier_id", "name") +VALUES (1031216928, 14, 1, 1033922106, 14, 'Content'), + (1031216941, 14, 2, 1033922113, 14, 'Users'), + (1032009743, 14, 3, 1033922120, 14, 'Media'); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentobject" ("contentclass_id", "current_version", "id", "initial_language_id", "language_mask", "modified", "name", "owner_id", "published", "remote_id", "section_id", "status") +VALUES (1,9,1,2,3,1448889046,'Ibexa Platform',14,1448889046,'9459d3c29e15006e45197295722c7ade',1,1), + (3,1,4,2,3,1033917596,'Users',14,1033917596,'f5c88a2209584891056f987fd965b0ba',2,1), + (4,2,10,2,3,1072180405,'Anonymous User',14,1033920665,'faaeb9be3bd98ed09f606fc16d144eca',2,1), + (3,1,11,2,3,1033920746,'Guest accounts',14,1033920746,'5f7f0bdb3381d6a461d8c29ff53d908f',2,1), + (3,1,12,2,3,1033920775,'Administrator users',14,1033920775,'9b47a45624b023b1a76c73b74d704acf',2,1), + (3,1,13,2,3,1033920794,'Editors',14,1033920794,'3c160cca19fb135f83bd02d911f04db2',2,1), + (4,3,14,2,3,1301062024,'Administrator User',14,1033920830,'1bb4fe25487f05527efa8bfd394cecc7',2,1), + (1,1,41,2,3,1060695457,'Media',14,1060695457,'a6e35cbcb7cd6ae4b691f3eee30cd262',3,1), + (3,1,42,2,3,1072180330,'Anonymous users',14,1072180330,'15b256dbea2ae72418ff5facc999e8f9',2,1), + (1,1,49,2,3,1080220197,'Images',14,1080220197,'e7ff633c6b8e0fd3531e74c6e712bead',3,1), + (1,1,50,2,3,1080220220,'Files',14,1080220220,'732a5acd01b51a6fe6eab448ad4138a9',3,1), + (1,1,51,2,3,1080220233,'Multimedia',14,1080220233,'09082deb98662a104f325aaa8c4933d3',3,1); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentobject_attribute" ("attribute_original_id", "contentclassattribute_id", "contentobject_id", "data_float", "data_int", "data_text", "data_type_string", "id", "language_code", "language_id", "sort_key_int", "sort_key_string", "version") +VALUES (0,4,1,NULL,NULL,'Ibexa Platform','ezstring',1,'eng-GB',3,0,'ibexa platform',9), + (0,119,1,NULL,NULL,E'
You are now ready to start your project.
','ezrichtext',2,'eng-GB',3,0,'',9), + (0,7,4,NULL,NULL,'Main group','ezstring',7,'eng-GB',3,0,'',1), + (0,6,4,NULL,NULL,'Users','ezstring',8,'eng-GB',3,0,'',1), + (0,8,10,0,0,'Anonymous','ezstring',19,'eng-GB',3,0,'anonymous',2), + (0,9,10,0,0,'User','ezstring',20,'eng-GB',3,0,'user',2), + (0,12,10,0,0,'','ezuser',21,'eng-GB',3,0,'',2), + (0,6,11,0,0,'Guest accounts','ezstring',22,'eng-GB',3,0,'',1), + (0,7,11,0,0,'','ezstring',23,'eng-GB',3,0,'',1), + (0,6,12,0,0,'Administrator users','ezstring',24,'eng-GB',3,0,'',1), + (0,7,12,0,0,'','ezstring',25,'eng-GB',3,0,'',1), + (0,6,13,0,0,'Editors','ezstring',26,'eng-GB',3,0,'',1), + (0,7,13,0,0,'','ezstring',27,'eng-GB',3,0,'',1), + (0,8,14,0,0,'Administrator','ezstring',28,'eng-GB',3,0,'administrator',3), + (0,9,14,0,0,'User','ezstring',29,'eng-GB',3,0,'user',3), + (30,12,14,0,0,'','ezuser',30,'eng-GB',3,0,'',3), + (0,4,41,0,0,'Media','ezstring',98,'eng-GB',3,0,'',1), + (0,119,41,0,1045487555,E'\n
\n','ezrichtext',99,'eng-GB',3,0,'',1), + (0,6,42,0,0,'Anonymous users','ezstring',100,'eng-GB',3,0,'anonymous users',1), + (0,7,42,0,0,'User group for the anonymous user','ezstring',101,'eng-GB',3,0,'user group for the anonymous user',1), + (0,155,1,NULL,NULL,'Ibexa Platform','ezstring',102,'eng-GB',3,0,'ibexa platform',9), + (0,155,41,0,0,'','ezstring',103,'eng-GB',3,0,'',1), + (0,156,1,NULL,NULL,E'
This is the clean installation coming with Ibexa Platform.It''s a bare-bones setup of the Platform, an excellent foundation to build upon if you want to start your project from scratch.
','ezrichtext',104,'eng-GB',3,0,'',9), + (0,156,41,0,1045487555,E'\n
\n','ezrichtext',105,'eng-GB',3,0,'',1), + (0,4,49,0,0,'Images','ezstring',142,'eng-GB',3,0,'images',1), + (0,155,49,0,0,'','ezstring',143,'eng-GB',3,0,'',1), + (0,119,49,0,1045487555,E'\n
\n','ezrichtext',144,'eng-GB',3,0,'',1), + (0,156,49,0,1045487555,E'\n
\n','ezrichtext',145,'eng-GB',3,0,'',1), + (0,4,50,0,0,'Files','ezstring',147,'eng-GB',3,0,'files',1), + (0,155,50,0,0,'','ezstring',148,'eng-GB',3,0,'',1), + (0,119,50,0,1045487555,E'\n
\n','ezrichtext',149,'eng-GB',3,0,'',1), + (0,156,50,0,1045487555,E'\n
\n','ezrichtext',150,'eng-GB',3,0,'',1), + (0,4,51,0,0,'Multimedia','ezstring',152,'eng-GB',3,0,'multimedia',1), + (0,155,51,0,0,'','ezstring',153,'eng-GB',3,0,'',1), + (0,119,51,0,1045487555,E'\n
\n','ezrichtext',154,'eng-GB',3,0,'',1), + (0,156,51,0,1045487555,E'\n
\n','ezrichtext',155,'eng-GB',3,0,'',1), + (0,179,10,0,0,'','eztext',177,'eng-GB',3,0,'',2), + (0,179,14,0,0,'','eztext',178,'eng-GB',3,0,'',3), + (0,180,10,0,0,'','ezimage',179,'eng-GB',3,0,'',2), + (0,180,14,0,0,E'\n\n','ezimage',180,'eng-GB',3,0,'',3); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentobject_name" ("content_translation", "content_version", "contentobject_id", "language_id", "name", "real_translation") +VALUES ('eng-GB',9,1,2,'Ibexa Platform','eng-GB'), + ('eng-GB',1,4,3,'Users','eng-GB'), + ('eng-GB',2,10,3,'Anonymous User','eng-GB'), + ('eng-GB',1,11,3,'Guest accounts','eng-GB'), + ('eng-GB',1,12,3,'Administrator users','eng-GB'), + ('eng-GB',1,13,3,'Editors','eng-GB'), + ('eng-GB',3,14,3,'Administrator User','eng-GB'), + ('eng-GB',1,41,3,'Media','eng-GB'), + ('eng-GB',1,42,3,'Anonymous users','eng-GB'), + ('eng-GB',1,49,3,'Images','eng-GB'), + ('eng-GB',1,50,3,'Files','eng-GB'), + ('eng-GB',1,51,3,'Multimedia','eng-GB'); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentobject_tree" ("contentobject_id", "contentobject_is_published", "contentobject_version", "depth", "is_hidden", "is_invisible", "main_node_id", "modified_subnode", "node_id", "parent_node_id", "path_identification_string", "path_string", "priority", "remote_id", "sort_field", "sort_order") +VALUES (0,1,1,0,0,0,1,1448999778,1,1,'','/1/',0,'629709ba256fe317c3ddcee35453a96a',1,1), + (1,1,9,1,0,0,2,1301073466,2,1,'node_2','/1/2/',0,'f3e90596361e31d496d4026eb624c983',8,1), + (4,1,1,1,0,0,5,1301062024,5,1,'users','/1/5/',0,'3f6d92f8044aed134f32153517850f5a',1,1), + (11,1,1,2,0,0,12,1081860719,12,5,'users/guest_accounts','/1/5/12/',0,'602dcf84765e56b7f999eaafd3821dd3',1,1), + (12,1,1,2,0,0,13,1301062024,13,5,'users/administrator_users','/1/5/13/',0,'769380b7aa94541679167eab817ca893',1,1), + (13,1,1,2,0,0,14,1081860719,14,5,'users/editors','/1/5/14/',0,'f7dda2854fc68f7c8455d9cb14bd04a9',1,1), + (14,1,3,3,0,0,15,1301062024,15,13,'users/administrator_users/administrator_user','/1/5/13/15/',0,'e5161a99f733200b9ed4e80f9c16187b',1,1), + (41,1,1,1,0,0,43,1081860720,43,1,'media','/1/43/',0,'75c715a51699d2d309a924eca6a95145',9,1), + (42,1,1,2,0,0,44,1081860719,44,5,'users/anonymous_users','/1/5/44/',0,'4fdf0072da953bb276c0c7e0141c5c9b',9,1), + (10,1,2,3,0,0,45,1081860719,45,44,'users/anonymous_users/anonymous_user','/1/5/44/45/',0,'2cf8343bee7b482bab82b269d8fecd76',9,1), + (49,1,1,2,0,0,51,1081860720,51,43,'media/images','/1/43/51/',0,'1b26c0454b09bb49dfb1b9190ffd67cb',9,1), + (50,1,1,2,0,0,52,1081860720,52,43,'media/files','/1/43/52/',0,'0b113a208f7890f9ad3c24444ff5988c',9,1), + (51,1,1,2,0,0,53,1081860720,53,43,'media/multimedia','/1/43/53/',0,'4f18b82c75f10aad476cae5adf98c11f',9,1); +-- ibexa:sql-statement-separator +INSERT INTO "ezcontentobject_version" ("contentobject_id", "created", "creator_id", "id", "initial_language_id", "language_mask", "modified", "status", "user_id", "version", "workflow_event_pos") +VALUES (4,0,14,4,2,3,0,1,0,1,1), + (11,1033920737,14,439,2,3,1033920746,1,0,1,0), + (12,1033920760,14,440,2,3,1033920775,1,0,1,0), + (13,1033920786,14,441,2,3,1033920794,1,0,1,0), + (41,1060695450,14,472,2,3,1060695457,1,0,1,0), + (42,1072180278,14,473,2,3,1072180330,1,0,1,0), + (10,1072180337,14,474,2,3,1072180405,1,0,2,0), + (49,1080220181,14,488,2,3,1080220197,1,0,1,0), + (50,1080220211,14,489,2,3,1080220220,1,0,1,0), + (51,1080220225,14,490,2,3,1080220233,1,0,1,0), + (14,1301061783,14,499,2,3,1301062024,1,0,3,0), + (1,1448889045,14,506,2,3,1448889046,1,0,9,0); +-- ibexa:sql-statement-separator +INSERT INTO "eznode_assignment" ("contentobject_id", "contentobject_version", "from_node_id", "id", "is_main", "op_code", "parent_node", "parent_remote_id", "remote_id", "sort_field", "sort_order", "priority", "is_hidden") +VALUES (8,2,0,4,1,2,5,'','0',1,1,0,0), + (42,1,0,5,1,2,5,'','0',9,1,0,0), + (10,2,-1,6,1,2,44,'','0',9,1,0,0), + (4,1,0,7,1,2,1,'','0',1,1,0,0), + (12,1,0,8,1,2,5,'','0',1,1,0,0), + (13,1,0,9,1,2,5,'','0',1,1,0,0), + (41,1,0,11,1,2,1,'','0',1,1,0,0), + (11,1,0,12,1,2,5,'','0',1,1,0,0), + (49,1,0,27,1,2,43,'','0',9,1,0,0), + (50,1,0,28,1,2,43,'','0',9,1,0,0), + (51,1,0,29,1,2,43,'','0',9,1,0,0), + (14,3,-1,38,1,2,13,'','0',1,1,0,0); +-- ibexa:sql-statement-separator +INSERT INTO "ezpolicy" ("function_name", "id", "module_name", "original_id", "role_id") +VALUES ('*',317,'content',0,3), + ('login',319,'user',0,3), + ('read',328,'content',0,1), + ('login',331,'user',0,1), + ('*',332,'*',0,2), + ('read',333,'content',0,4), + ('view_embed',334,'content',0,1), + ('*',340,'url',0,3); +-- ibexa:sql-statement-separator +INSERT INTO "ezpolicy_limitation" ("id", "identifier", "policy_id") +VALUES (251,'Section',328), + (252,'Section',329), + (253,'SiteAccess',331), + (254,'Class',333), + (255,'Owner',333), + (256,'Class',334); +-- ibexa:sql-statement-separator +INSERT INTO "ezpolicy_limitation_value" ("id", "limitation_id", "value") +VALUES (477,251,'1'), + (478,252,'1'), + (479,253,'1766001124'), + (480,254,'4'), + (481,255,'1'), + (482,256,'5'), + (483,256,'12'); +-- ibexa:sql-statement-separator +INSERT INTO "ezrole" ("id", "is_new", "name", "value", "version") +VALUES (1,0,'Anonymous','',0), + (2,0,'Administrator','0',0), + (3,0,'Editor','',0), + (4,0,'Member','',0); +-- ibexa:sql-statement-separator +INSERT INTO "ezsection" ("id", "identifier", "locale", "name", "navigation_part_identifier") +VALUES (1,'standard','','Standard','ezcontentnavigationpart'), + (2,'users','','Users','ezusernavigationpart'), + (3,'media','','Media','ezmedianavigationpart'); +-- ibexa:sql-statement-separator +INSERT INTO "ezsite_data" ("name", "value") +VALUES ('ibexa-release','4.6'); +-- ibexa:sql-statement-separator +INSERT INTO "ezurlalias" ("destination_url", "forward_to_id", "id", "is_imported", "is_internal", "is_wildcard", "source_md5", "source_url") +VALUES ('content/view/full/2',0,12,1,1,0,'d41d8cd98f00b204e9800998ecf8427e',''), + ('content/view/full/5',0,13,1,1,0,'9bc65c2abec141778ffaa729489f3e87','users'), + ('content/view/full/12',0,15,1,1,0,'02d4e844e3a660857a3f81585995ffe1','users/guest_accounts'), + ('content/view/full/13',0,16,1,1,0,'1b1d79c16700fd6003ea7be233e754ba','users/administrator_users'), + ('content/view/full/14',0,17,1,1,0,'0bb9dd665c96bbc1cf36b79180786dea','users/editors'), + ('content/view/full/15',0,18,1,1,0,'f1305ac5f327a19b451d82719e0c3f5d','users/administrator_users/administrator_user'), + ('content/view/full/43',0,20,1,1,0,'62933a2951ef01f4eafd9bdf4d3cd2f0','media'), + ('content/view/full/44',0,21,1,1,0,'3ae1aac958e1c82013689d917d34967a','users/anonymous_users'), + ('content/view/full/45',0,22,1,1,0,'aad93975f09371695ba08292fd9698db','users/anonymous_users/anonymous_user'), + ('content/view/full/51',0,28,1,1,0,'38985339d4a5aadfc41ab292b4527046','media/images'), + ('content/view/full/52',0,29,1,1,0,'ad5a8c6f6aac3b1b9df267fe22e7aef6','media/files'), + ('content/view/full/53',0,30,1,1,0,'562a0ac498571c6c3529173184a2657c','media/multimedia'); +-- ibexa:sql-statement-separator +INSERT INTO "ezurlalias_ml" ("action", "action_type", "alias_redirects", "id", "is_alias", "is_original", "lang_mask", "link", "parent", "text", "text_md5") +VALUES ('nop:','nop',1,17,0,0,1,17,0,'media2','50e2736330de124f6edea9b008556fe6'), + ('eznode:43','eznode',1,9,0,1,3,9,0,'Media','62933a2951ef01f4eafd9bdf4d3cd2f0'), + ('nop:','nop',1,3,0,0,1,3,0,'users2','86425c35a33507d479f71ade53a669aa'), + ('eznode:5','eznode',1,2,0,1,3,2,0,'Users','9bc65c2abec141778ffaa729489f3e87'), + ('eznode:2','eznode',1,1,0,1,3,1,0,'','d41d8cd98f00b204e9800998ecf8427e'), + ('eznode:14','eznode',1,6,0,1,3,6,2,'Editors','a147e136bfa717592f2bd70bd4b53b17'), + ('eznode:44','eznode',1,10,0,1,3,10,2,'Anonymous-Users','c2803c3fa1b0b5423237b4e018cae755'), + ('eznode:12','eznode',1,4,0,1,3,4,2,'Guest-accounts','e57843d836e3af8ab611fde9e2139b3a'), + ('eznode:13','eznode',1,5,0,1,3,5,2,'Administrator-users','f89fad7f8a3abc8c09e1deb46a420007'), + ('nop:','nop',1,11,0,0,1,11,3,'anonymous_users2','505e93077a6dde9034ad97a14ab022b1'), + ('eznode:12','eznode',1,26,0,0,1,4,3,'guest_accounts','70bb992820e73638731aa8de79b3329e'), + ('eznode:14','eznode',1,29,0,0,1,6,3,'editors','a147e136bfa717592f2bd70bd4b53b17'), + ('nop:','nop',1,7,0,0,1,7,3,'administrator_users2','a7da338c20bf65f9f789c87296379c2a'), + ('eznode:13','eznode',1,27,0,0,1,5,3,'administrator_users','aeb8609aa933b0899aa012c71139c58c'), + ('eznode:44','eznode',1,30,0,0,1,10,3,'anonymous_users','e9e5ad0c05ee1a43715572e5cc545926'), + ('eznode:15','eznode',1,8,0,1,3,8,5,'Administrator-User','5a9d7b0ec93173ef4fedee023209cb61'), + ('eznode:15','eznode',1,28,0,0,0,8,7,'administrator_user','a3cca2de936df1e2f805710399989971'), + ('eznode:53','eznode',1,20,0,1,3,20,9,'Multimedia','2e5bc8831f7ae6a29530e7f1bbf2de9c'), + ('eznode:52','eznode',1,19,0,1,3,19,9,'Files','45b963397aa40d4a0063e0d85e4fe7a1'), + ('eznode:51','eznode',1,18,0,1,3,18,9,'Images','59b514174bffe4ae402b3d63aad79fe0'), + ('eznode:45','eznode',1,12,0,1,3,12,10,'Anonymous-User','ccb62ebca03a31272430bc414bd5cd5b'), + ('eznode:45','eznode',1,31,0,0,1,12,11,'anonymous_user','c593ec85293ecb0e02d50d4c5c6c20eb'), + ('eznode:53','eznode',1,34,0,0,1,20,17,'multimedia','2e5bc8831f7ae6a29530e7f1bbf2de9c'), + ('eznode:52','eznode',1,33,0,0,1,19,17,'files','45b963397aa40d4a0063e0d85e4fe7a1'), + ('eznode:51','eznode',1,32,0,0,1,18,17,'images','59b514174bffe4ae402b3d63aad79fe0'); +-- ibexa:sql-statement-separator +INSERT INTO "ezurlalias_ml_incr" ("id") +VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15), (16), (17), + (18), (19), (20), (21), (22), (24), (25), (26), (27), (28), (29), (30), (31), (32), (33), + (34), (35), (36), (37); +-- ibexa:sql-statement-separator +INSERT INTO "ezuser" ("contentobject_id", "email", "login", "password_hash", "password_hash_type") +VALUES (10,'anonymous@link.invalid','anonymous','$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',7), + (14,'admin@link.invalid','admin','$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',7); +-- ibexa:sql-statement-separator +INSERT INTO "ezuser_role" ("contentobject_id", "id", "limit_identifier", "limit_value", "role_id") +VALUES (11,28,'','',1), + (42,31,'','',1), + (13,32,'Subtree','/1/2/',3), + (13,33,'Subtree','/1/43/',3), + (12,34,'','',2), + (13,35,'','',4); +-- ibexa:sql-statement-separator +INSERT INTO "ezuser_setting" ("is_enabled", "max_login", "user_id") +VALUES (1, 1000, 10), + (1, 10, 14); +-- ibexa:sql-statement-separator +INSERT INTO "ezpreferences" ("name", "user_id", "value") +SELECT 'focus_mode', u.contentobject_id, '0' FROM "ezuser" u WHERE u.login = 'admin'; +-- ibexa:sql-statement-separator +-- Set proper sequence values after inserting data +SELECT SETVAL('ezcobj_state_group_id_seq', COALESCE(MAX(id), 1) ) FROM ezcobj_state_group; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcobj_state_id_seq', COALESCE(MAX(id), 1) ) FROM ezcobj_state; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentbrowsebookmark_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentbrowsebookmark; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentclass_attribute_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentclass_attribute; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentclass_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentclass; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentclassgroup_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentclassgroup; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentobject_attribute_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentobject_attribute; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentobject_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentobject; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentobject_link_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentobject_link; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentobject_tree_node_id_seq', COALESCE(MAX(node_id), 1) ) FROM ezcontentobject_tree; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezcontentobject_version_id_seq', COALESCE(MAX(id), 1) ) FROM ezcontentobject_version; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezimagefile_id_seq', COALESCE(MAX(id), 1) ) FROM ezimagefile; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezkeyword_attribute_link_id_seq', COALESCE(MAX(id), 1) ) FROM ezkeyword_attribute_link; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezkeyword_id_seq', COALESCE(MAX(id), 1) ) FROM ezkeyword; +-- ibexa:sql-statement-separator +SELECT SETVAL('eznode_assignment_id_seq', COALESCE(MAX(id), 1) ) FROM eznode_assignment; +-- ibexa:sql-statement-separator +SELECT SETVAL('eznotification_id_seq', COALESCE(MAX(id), 1) ) FROM eznotification; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezpackage_id_seq', COALESCE(MAX(id), 1) ) FROM ezpackage; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezpolicy_id_seq', COALESCE(MAX(id), 1) ) FROM ezpolicy; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezpolicy_limitation_id_seq', COALESCE(MAX(id), 1) ) FROM ezpolicy_limitation; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezpolicy_limitation_value_id_seq', COALESCE(MAX(id), 1) ) FROM ezpolicy_limitation_value; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezpreferences_id_seq', COALESCE(MAX(id), 1) ) FROM ezpreferences; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezrole_id_seq', COALESCE(MAX(id), 1) ) FROM ezrole; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezsearch_object_word_link_id_seq', COALESCE(MAX(id), 1) ) FROM ezsearch_object_word_link; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezsearch_word_id_seq', COALESCE(MAX(id), 1) ) FROM ezsearch_word; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezsection_id_seq', COALESCE(MAX(id), 1) ) FROM ezsection; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezurl_id_seq', COALESCE(MAX(id), 1) ) FROM ezurl; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezurlalias_id_seq', COALESCE(MAX(id), 1) ) FROM ezurlalias; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezurlalias_ml_incr_id_seq', COALESCE(MAX(id), 1) ) FROM ezurlalias_ml_incr; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezurlwildcard_id_seq', COALESCE(MAX(id), 1) ) FROM ezurlwildcard; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezuser_accountkey_id_seq', COALESCE(MAX(id), 1) ) FROM ezuser_accountkey; +-- ibexa:sql-statement-separator +SELECT SETVAL('ezuser_role_id_seq', COALESCE(MAX(id), 1) ) FROM ezuser_role; diff --git a/src/bundle/RepositoryInstaller/Migration/sql/import-data-sqlite.sql b/src/bundle/RepositoryInstaller/Migration/sql/import-data-sqlite.sql new file mode 100644 index 0000000000..98a6a7d279 --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/import-data-sqlite.sql @@ -0,0 +1,322 @@ +INSERT INTO `ezcobj_state` (`default_language_id`, `group_id`, `id`, `identifier`, `language_mask`, `priority`) +VALUES (2, 2, 1, 'not_locked', 3, 0), + (2, 2, 2, 'locked', 3, 1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_group` (`default_language_id`, `id`, `identifier`, `language_mask`) +VALUES (2,2,'ez_lock',3); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_group_language` (`contentobject_state_group_id`, `description`, `language_id`, `name`, `real_language_id`) +VALUES (2,'',3,'Lock',2); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_language` (`contentobject_state_id`, `description`, `language_id`, `name`) +VALUES (1,'',3,'Not locked'), + (2,'',3,'Locked'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcobj_state_link` (`contentobject_id`, `contentobject_state_id`) +VALUES (1, 1), + (4, 1), + (10, 1), + (11, 1), + (12, 1), + (13, 1), + (14, 1), + (41, 1), + (42, 1), + (49, 1), + (50, 1), + (51, 1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontent_language` (`disabled`, `id`, `locale`, `name`) +VALUES (0, 2, 'eng-GB', 'English (United Kingdom)'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass` (`always_available`, `contentobject_name`, `created`, `creator_id`, `id`, `identifier`, `initial_language_id`, `is_container`, `language_mask`, `modified`, `modifier_id`, `remote_id`, `serialized_description_list`, `serialized_name_list`, `sort_field`, `sort_order`, `url_alias_name`, `version`) +VALUES (1,'',1024392098,14,1,'folder',2,1,2,1448831672,14,'a3d405b81be900468eb153d774f4f0d2','a:0:{}','a:1:{s:6:"eng-GB";s:6:"Folder";}',1,1,NULL,0), + (0,'',1024392098,14,2,'article',2,1,3,1082454989,14,'c15b600eb9198b1924063b5a68758232',NULL,'a:2:{s:6:"eng-GB";s:7:"Article";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,'',1024392098,14,3,'user_group',2,1,3,1048494743,14,'25b4268cdcd01921b808a0d854b877ef',NULL,'a:2:{s:6:"eng-GB";s:10:"User group";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,' ',1024392098,14,4,'user',2,0,3,1082018364,14,'40faa822edc579b02c25f6bb7beec3ad',NULL,'a:2:{s:6:"eng-GB";s:4:"User";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,'',1031484992,14,5,'image',2,0,3,1048494784,14,'f6df12aa74e36230eb675f364fccd25a',NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0), + (1,'',1052385472,14,12,'file',2,0,3,1052385669,14,'637d58bfddf164627bdfd265733280a0',NULL,'a:2:{s:6:"eng-GB";s:4:"File";s:16:"always-available";s:6:"eng-GB";}',1,1,NULL,0); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass_attribute` (`can_translate`, `category`, `contentclass_id`, `data_float1`, `data_float2`, `data_float3`, `data_float4`, `data_int1`, `data_int2`, `data_int3`, `data_int4`, `data_text1`, `data_text2`, `data_text3`, `data_text4`, `data_text5`, `data_type_string`, `id`, `identifier`, `is_information_collector`, `is_required`, `is_searchable`, `is_thumbnail`, `placement`, `serialized_data_text`, `serialized_description_list`, `serialized_name_list`, `version`) +VALUES (1,'',2,0,0,0,0,255,0,0,0,'New article','','','','','ezstring',1,'title',0,1,1,1,0,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Title";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',1,NULL,NULL,NULL,NULL,255,0,NULL,NULL,'Folder',NULL,NULL,NULL,NULL,'ezstring',4,'name',0,1,1,0,1,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:4:"Name";}',0), + (1,'',3,0,0,0,0,255,0,0,0,'','','','',NULL,'ezstring',6,'name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',3,0,0,0,0,255,0,0,0,'','','','',NULL,'ezstring',7,'description',0,0,1,0,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:11:"Description";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',4,0,0,0,0,255,0,0,0,'','','','','','ezstring',8,'first_name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:10:"First name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',4,0,0,0,0,255,0,0,0,'','','','','','ezstring',9,'last_name',0,1,1,0,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:9:"Last name";s:16:"always-available";s:6:"eng-GB";}',0), + (0,'',4,0,0,0,0,7,10,0,0,'','^[^@]+$','','','','ezuser',12,'user_account',0,1,0,0,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:12:"User account";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',5,0,0,0,0,150,0,0,0,'','','','',NULL,'ezstring',116,'name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',5,0,0,0,0,10,0,0,0,'','','','',NULL,'ezrichtext',117,'caption',0,0,1,0,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:7:"Caption";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',5,10.0,0,0,0,0,0,0,0,'MB','','','',NULL,'ezimage',118,'image',0,0,1,1,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',1,NULL,NULL,NULL,NULL,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezrichtext',119,'short_description',0,0,1,0,3,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:17:"Short description";}',0), + (1,'',2,0,0,0,0,10,0,0,0,'','','','','','ezrichtext',120,'intro',0,1,1,0,4,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Intro";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,20,0,0,0,'','','','','','ezrichtext',121,'body',0,0,1,0,5,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Body";s:16:"always-available";s:6:"eng-GB";}',0), + (0,'',2,0,0,0,0,0,0,0,0,'','','','','','ezboolean',123,'enable_comments',0,0,0,0,6,NULL,NULL,'a:2:{s:6:"eng-GB";s:15:"Enable comments";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',12,0,0,0,0,0,0,0,0,'New file','','','',NULL,'ezstring',146,'name',0,1,1,0,1,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"Name";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',12,0,0,0,0,10,0,0,0,'','','','',NULL,'ezrichtext',147,'description',0,0,1,0,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:11:"Description";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',12,0,0,0,0,0,0,0,0,'','','','',NULL,'ezbinaryfile',148,'file',0,1,0,0,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:4:"File";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,255,0,0,0,'','','','','','ezstring',152,'short_title',0,0,1,0,2,NULL,NULL,'a:2:{s:6:"eng-GB";s:11:"Short title";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,1,0,0,0,'','','','','','ezauthor',153,'author',0,0,0,0,3,NULL,NULL,'a:2:{s:6:"eng-GB";s:6:"Author";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',2,0,0,0,0,0,0,0,0,'','','','','','ezobjectrelation',154,'image',0,0,1,0,7,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',1,NULL,NULL,NULL,NULL,100,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezstring',155,'short_name',0,0,1,0,2,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:10:"Short name";}',0), + (1,'',1,NULL,NULL,NULL,NULL,20,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ezrichtext',156,'description',0,0,1,0,4,'N;','a:0:{}','a:1:{s:6:"eng-GB";s:11:"Description";}',0), + (1,'',4,0,0,0,0,10,0,0,0,'','','','','','eztext',179,'signature',0,0,1,0,4,NULL,NULL,'a:2:{s:6:"eng-GB";s:9:"Signature";s:16:"always-available";s:6:"eng-GB";}',0), + (1,'',4,10.0,0,0,0,0,0,0,0,'MB','','','','','ezimage',180,'image',0,0,0,1,5,NULL,NULL,'a:2:{s:6:"eng-GB";s:5:"Image";s:16:"always-available";s:6:"eng-GB";}',0); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass_classgroup` (`contentclass_id`, `contentclass_version`, `group_id`, `group_name`) +VALUES (1, 0, 1, 'Content'), + (2, 0, 1, 'Content'), + (3, 0, 2, 'Users'), + (4, 0, 2, 'Users'), + (5, 0, 3, 'Media'), + (12, 0, 3, 'Media'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclass_name` (`contentclass_id`, `contentclass_version`, `language_id`, `language_locale`, `name`) +VALUES (1, 0, 2, 'eng-GB', 'Folder'), + (2, 0, 3, 'eng-GB', 'Article'), + (3, 0, 3, 'eng-GB', 'User group'), + (4, 0, 3, 'eng-GB', 'User'), + (5, 0, 3, 'eng-GB', 'Image'), + (12, 0, 3, 'eng-GB', 'File'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentclassgroup` (`created`, `creator_id`, `id`, `modified`, `modifier_id`, `name`) +VALUES (1031216928, 14, 1, 1033922106, 14, 'Content'), + (1031216941, 14, 2, 1033922113, 14, 'Users'), + (1032009743, 14, 3, 1033922120, 14, 'Media'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject` (`contentclass_id`, `current_version`, `id`, `initial_language_id`, `language_mask`, `modified`, `name`, `owner_id`, `published`, `remote_id`, `section_id`, `status`) +VALUES (1,9,1,2,3,1448889046,'Ibexa Platform',14,1448889046,'9459d3c29e15006e45197295722c7ade',1,1), + (3,1,4,2,3,1033917596,'Users',14,1033917596,'f5c88a2209584891056f987fd965b0ba',2,1), + (4,2,10,2,3,1072180405,'Anonymous User',14,1033920665,'faaeb9be3bd98ed09f606fc16d144eca',2,1), + (3,1,11,2,3,1033920746,'Guest accounts',14,1033920746,'5f7f0bdb3381d6a461d8c29ff53d908f',2,1), + (3,1,12,2,3,1033920775,'Administrator users',14,1033920775,'9b47a45624b023b1a76c73b74d704acf',2,1), + (3,1,13,2,3,1033920794,'Editors',14,1033920794,'3c160cca19fb135f83bd02d911f04db2',2,1), + (4,3,14,2,3,1301062024,'Administrator User',14,1033920830,'1bb4fe25487f05527efa8bfd394cecc7',2,1), + (1,1,41,2,3,1060695457,'Media',14,1060695457,'a6e35cbcb7cd6ae4b691f3eee30cd262',3,1), + (3,1,42,2,3,1072180330,'Anonymous users',14,1072180330,'15b256dbea2ae72418ff5facc999e8f9',2,1), + (1,1,49,2,3,1080220197,'Images',14,1080220197,'e7ff633c6b8e0fd3531e74c6e712bead',3,1), + (1,1,50,2,3,1080220220,'Files',14,1080220220,'732a5acd01b51a6fe6eab448ad4138a9',3,1), + (1,1,51,2,3,1080220233,'Multimedia',14,1080220233,'09082deb98662a104f325aaa8c4933d3',3,1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_attribute` (`attribute_original_id`, `contentclassattribute_id`, `contentobject_id`, `data_float`, `data_int`, `data_text`, `data_type_string`, `id`, `language_code`, `language_id`, `sort_key_int`, `sort_key_string`, `version`) +VALUES (0,4,1,NULL,NULL,'Ibexa Platform','ezstring',1,'eng-GB',3,0,'ibexa platform',9), + (0,119,1,NULL,NULL,'
You are now ready to start your project.
','ezrichtext',2,'eng-GB',3,0,'',9), + (0,7,4,NULL,NULL,'Main group','ezstring',7,'eng-GB',3,0,'',1), + (0,6,4,NULL,NULL,'Users','ezstring',8,'eng-GB',3,0,'',1), + (0,8,10,0,0,'Anonymous','ezstring',19,'eng-GB',3,0,'anonymous',2), + (0,9,10,0,0,'User','ezstring',20,'eng-GB',3,0,'user',2), + (0,12,10,0,0,'','ezuser',21,'eng-GB',3,0,'',2), + (0,6,11,0,0,'Guest accounts','ezstring',22,'eng-GB',3,0,'',1), + (0,7,11,0,0,'','ezstring',23,'eng-GB',3,0,'',1), + (0,6,12,0,0,'Administrator users','ezstring',24,'eng-GB',3,0,'',1), + (0,7,12,0,0,'','ezstring',25,'eng-GB',3,0,'',1), + (0,6,13,0,0,'Editors','ezstring',26,'eng-GB',3,0,'',1), + (0,7,13,0,0,'','ezstring',27,'eng-GB',3,0,'',1), + (0,8,14,0,0,'Administrator','ezstring',28,'eng-GB',3,0,'administrator',3), + (0,9,14,0,0,'User','ezstring',29,'eng-GB',3,0,'user',3), + (30,12,14,0,0,'','ezuser',30,'eng-GB',3,0,'',3), + (0,4,41,0,0,'Media','ezstring',98,'eng-GB',3,0,'',1), + (0,119,41,0,1045487555,' +
+','ezrichtext',99,'eng-GB',3,0,'',1), + (0,6,42,0,0,'Anonymous users','ezstring',100,'eng-GB',3,0,'anonymous users',1), + (0,7,42,0,0,'User group for the anonymous user','ezstring',101,'eng-GB',3,0,'user group for the anonymous user',1), + (0,155,1,NULL,NULL,'Ibexa Platform','ezstring',102,'eng-GB',3,0,'ibexa platform',9), + (0,155,41,0,0,'','ezstring',103,'eng-GB',3,0,'',1), + (0,156,1,NULL,NULL,'
This is the clean installation coming with Ibexa Platform.It''s a bare-bones setup of the Platform, an excellent foundation to build upon if you want to start your project from scratch.
','ezrichtext',104,'eng-GB',3,0,'',9), + (0,156,41,0,1045487555,' +
+','ezrichtext',105,'eng-GB',3,0,'',1), + (0,4,49,0,0,'Images','ezstring',142,'eng-GB',3,0,'images',1), + (0,155,49,0,0,'','ezstring',143,'eng-GB',3,0,'',1), + (0,119,49,0,1045487555,' +
+','ezrichtext',144,'eng-GB',3,0,'',1), + (0,156,49,0,1045487555,' +
+','ezrichtext',145,'eng-GB',3,0,'',1), + (0,4,50,0,0,'Files','ezstring',147,'eng-GB',3,0,'files',1), + (0,155,50,0,0,'','ezstring',148,'eng-GB',3,0,'',1), + (0,119,50,0,1045487555,' +
+','ezrichtext',149,'eng-GB',3,0,'',1), + (0,156,50,0,1045487555,' +
+','ezrichtext',150,'eng-GB',3,0,'',1), + (0,4,51,0,0,'Multimedia','ezstring',152,'eng-GB',3,0,'multimedia',1), + (0,155,51,0,0,'','ezstring',153,'eng-GB',3,0,'',1), + (0,119,51,0,1045487555,' +
+','ezrichtext',154,'eng-GB',3,0,'',1), + (0,156,51,0,1045487555,' +
+','ezrichtext',155,'eng-GB',3,0,'',1), + (0,179,10,0,0,'','eztext',177,'eng-GB',3,0,'',2), + (0,179,14,0,0,'','eztext',178,'eng-GB',3,0,'',3), + (0,180,10,0,0,'','ezimage',179,'eng-GB',3,0,'',2), + (0,180,14,0,0,' + +','ezimage',180,'eng-GB',3,0,'',3); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_name` (`content_translation`, `content_version`, `contentobject_id`, `language_id`, `name`, `real_translation`) +VALUES ('eng-GB',9,1,2,'Ibexa Platform','eng-GB'), + ('eng-GB',1,4,3,'Users','eng-GB'), + ('eng-GB',2,10,3,'Anonymous User','eng-GB'), + ('eng-GB',1,11,3,'Guest accounts','eng-GB'), + ('eng-GB',1,12,3,'Administrator users','eng-GB'), + ('eng-GB',1,13,3,'Editors','eng-GB'), + ('eng-GB',3,14,3,'Administrator User','eng-GB'), + ('eng-GB',1,41,3,'Media','eng-GB'), + ('eng-GB',1,42,3,'Anonymous users','eng-GB'), + ('eng-GB',1,49,3,'Images','eng-GB'), + ('eng-GB',1,50,3,'Files','eng-GB'), + ('eng-GB',1,51,3,'Multimedia','eng-GB'); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_tree` (`contentobject_id`, `contentobject_is_published`, `contentobject_version`, `depth`, `is_hidden`, `is_invisible`, `main_node_id`, `modified_subnode`, `node_id`, `parent_node_id`, `path_identification_string`, `path_string`, `priority`, `remote_id`, `sort_field`, `sort_order`) +VALUES (0,1,1,0,0,0,1,1448999778,1,1,'','/1/',0,'629709ba256fe317c3ddcee35453a96a',1,1), + (1,1,9,1,0,0,2,1301073466,2,1,'node_2','/1/2/',0,'f3e90596361e31d496d4026eb624c983',8,1), + (4,1,1,1,0,0,5,1301062024,5,1,'users','/1/5/',0,'3f6d92f8044aed134f32153517850f5a',1,1), + (11,1,1,2,0,0,12,1081860719,12,5,'users/guest_accounts','/1/5/12/',0,'602dcf84765e56b7f999eaafd3821dd3',1,1), + (12,1,1,2,0,0,13,1301062024,13,5,'users/administrator_users','/1/5/13/',0,'769380b7aa94541679167eab817ca893',1,1), + (13,1,1,2,0,0,14,1081860719,14,5,'users/editors','/1/5/14/',0,'f7dda2854fc68f7c8455d9cb14bd04a9',1,1), + (14,1,3,3,0,0,15,1301062024,15,13,'users/administrator_users/administrator_user','/1/5/13/15/',0,'e5161a99f733200b9ed4e80f9c16187b',1,1), + (41,1,1,1,0,0,43,1081860720,43,1,'media','/1/43/',0,'75c715a51699d2d309a924eca6a95145',9,1), + (42,1,1,2,0,0,44,1081860719,44,5,'users/anonymous_users','/1/5/44/',0,'4fdf0072da953bb276c0c7e0141c5c9b',9,1), + (10,1,2,3,0,0,45,1081860719,45,44,'users/anonymous_users/anonymous_user','/1/5/44/45/',0,'2cf8343bee7b482bab82b269d8fecd76',9,1), + (49,1,1,2,0,0,51,1081860720,51,43,'media/images','/1/43/51/',0,'1b26c0454b09bb49dfb1b9190ffd67cb',9,1), + (50,1,1,2,0,0,52,1081860720,52,43,'media/files','/1/43/52/',0,'0b113a208f7890f9ad3c24444ff5988c',9,1), + (51,1,1,2,0,0,53,1081860720,53,43,'media/multimedia','/1/43/53/',0,'4f18b82c75f10aad476cae5adf98c11f',9,1); +-- ibexa:sql-statement-separator +INSERT INTO `ezcontentobject_version` (`contentobject_id`, `created`, `creator_id`, `id`, `initial_language_id`, `language_mask`, `modified`, `status`, `user_id`, `version`, `workflow_event_pos`) +VALUES (4,0,14,4,2,3,0,1,0,1,1), + (11,1033920737,14,439,2,3,1033920746,1,0,1,0), + (12,1033920760,14,440,2,3,1033920775,1,0,1,0), + (13,1033920786,14,441,2,3,1033920794,1,0,1,0), + (41,1060695450,14,472,2,3,1060695457,1,0,1,0), + (42,1072180278,14,473,2,3,1072180330,1,0,1,0), + (10,1072180337,14,474,2,3,1072180405,1,0,2,0), + (49,1080220181,14,488,2,3,1080220197,1,0,1,0), + (50,1080220211,14,489,2,3,1080220220,1,0,1,0), + (51,1080220225,14,490,2,3,1080220233,1,0,1,0), + (14,1301061783,14,499,2,3,1301062024,1,0,3,0), + (1,1448889045,14,506,2,3,1448889046,1,0,9,0); +-- ibexa:sql-statement-separator +INSERT INTO `eznode_assignment` (`contentobject_id`, `contentobject_version`, `from_node_id`, `id`, `is_main`, `op_code`, `parent_node`, `parent_remote_id`, `remote_id`, `sort_field`, `sort_order`, `priority`, `is_hidden`) +VALUES (8,2,0,4,1,2,5,'','0',1,1,0,0), + (42,1,0,5,1,2,5,'','0',9,1,0,0), + (10,2,-1,6,1,2,44,'','0',9,1,0,0), + (4,1,0,7,1,2,1,'','0',1,1,0,0), + (12,1,0,8,1,2,5,'','0',1,1,0,0), + (13,1,0,9,1,2,5,'','0',1,1,0,0), + (41,1,0,11,1,2,1,'','0',1,1,0,0), + (11,1,0,12,1,2,5,'','0',1,1,0,0), + (49,1,0,27,1,2,43,'','0',9,1,0,0), + (50,1,0,28,1,2,43,'','0',9,1,0,0), + (51,1,0,29,1,2,43,'','0',9,1,0,0), + (14,3,-1,38,1,2,13,'','0',1,1,0,0); +-- ibexa:sql-statement-separator +INSERT INTO `ezpolicy` (`function_name`, `id`, `module_name`, `original_id`, `role_id`) +VALUES ('*',317,'content',0,3), + ('login',319,'user',0,3), + ('read',328,'content',0,1), + ('login',331,'user',0,1), + ('*',332,'*',0,2), + ('read',333,'content',0,4), + ('view_embed',334,'content',0,1), + ('*',340,'url',0,3); +-- ibexa:sql-statement-separator +INSERT INTO `ezpolicy_limitation` (`id`, `identifier`, `policy_id`) +VALUES (251,'Section',328), + (252,'Section',329), + (253,'SiteAccess',331), + (254,'Class',333), + (255,'Owner',333), + (256,'Class',334); +-- ibexa:sql-statement-separator +INSERT INTO `ezpolicy_limitation_value` (`id`, `limitation_id`, `value`) +VALUES (477,251,'1'), + (478,252,'1'), + (479,253,'1766001124'), + (480,254,'4'), + (481,255,'1'), + (482,256,'5'), + (483,256,'12'); +-- ibexa:sql-statement-separator +INSERT INTO `ezrole` (`id`, `is_new`, `name`, `value`, `version`) +VALUES (1,0,'Anonymous','',0), + (2,0,'Administrator','0',0), + (3,0,'Editor','',0), + (4,0,'Member','',0); +-- ibexa:sql-statement-separator +INSERT INTO `ezsection` (`id`, `identifier`, `locale`, `name`, `navigation_part_identifier`) +VALUES (1,'standard','','Standard','ezcontentnavigationpart'), + (2,'users','','Users','ezusernavigationpart'), + (3,'media','','Media','ezmedianavigationpart'); +-- ibexa:sql-statement-separator +INSERT INTO `ezsite_data` (`name`, `value`) +VALUES ('ibexa-release','4.6'); +-- ibexa:sql-statement-separator +INSERT INTO `ezurlalias` (`destination_url`, `forward_to_id`, `id`, `is_imported`, `is_internal`, `is_wildcard`, `source_md5`, `source_url`) +VALUES ('content/view/full/2',0,12,1,1,0,'d41d8cd98f00b204e9800998ecf8427e',''), + ('content/view/full/5',0,13,1,1,0,'9bc65c2abec141778ffaa729489f3e87','users'), + ('content/view/full/12',0,15,1,1,0,'02d4e844e3a660857a3f81585995ffe1','users/guest_accounts'), + ('content/view/full/13',0,16,1,1,0,'1b1d79c16700fd6003ea7be233e754ba','users/administrator_users'), + ('content/view/full/14',0,17,1,1,0,'0bb9dd665c96bbc1cf36b79180786dea','users/editors'), + ('content/view/full/15',0,18,1,1,0,'f1305ac5f327a19b451d82719e0c3f5d','users/administrator_users/administrator_user'), + ('content/view/full/43',0,20,1,1,0,'62933a2951ef01f4eafd9bdf4d3cd2f0','media'), + ('content/view/full/44',0,21,1,1,0,'3ae1aac958e1c82013689d917d34967a','users/anonymous_users'), + ('content/view/full/45',0,22,1,1,0,'aad93975f09371695ba08292fd9698db','users/anonymous_users/anonymous_user'), + ('content/view/full/51',0,28,1,1,0,'38985339d4a5aadfc41ab292b4527046','media/images'), + ('content/view/full/52',0,29,1,1,0,'ad5a8c6f6aac3b1b9df267fe22e7aef6','media/files'), + ('content/view/full/53',0,30,1,1,0,'562a0ac498571c6c3529173184a2657c','media/multimedia'); +-- ibexa:sql-statement-separator +INSERT INTO `ezurlalias_ml` (`action`, `action_type`, `alias_redirects`, `id`, `is_alias`, `is_original`, `lang_mask`, `link`, `parent`, `text`, `text_md5`) +VALUES ('nop:','nop',1,17,0,0,1,17,0,'media2','50e2736330de124f6edea9b008556fe6'), + ('eznode:43','eznode',1,9,0,1,3,9,0,'Media','62933a2951ef01f4eafd9bdf4d3cd2f0'), + ('nop:','nop',1,3,0,0,1,3,0,'users2','86425c35a33507d479f71ade53a669aa'), + ('eznode:5','eznode',1,2,0,1,3,2,0,'Users','9bc65c2abec141778ffaa729489f3e87'), + ('eznode:2','eznode',1,1,0,1,3,1,0,'','d41d8cd98f00b204e9800998ecf8427e'), + ('eznode:14','eznode',1,6,0,1,3,6,2,'Editors','a147e136bfa717592f2bd70bd4b53b17'), + ('eznode:44','eznode',1,10,0,1,3,10,2,'Anonymous-Users','c2803c3fa1b0b5423237b4e018cae755'), + ('eznode:12','eznode',1,4,0,1,3,4,2,'Guest-accounts','e57843d836e3af8ab611fde9e2139b3a'), + ('eznode:13','eznode',1,5,0,1,3,5,2,'Administrator-users','f89fad7f8a3abc8c09e1deb46a420007'), + ('nop:','nop',1,11,0,0,1,11,3,'anonymous_users2','505e93077a6dde9034ad97a14ab022b1'), + ('eznode:12','eznode',1,26,0,0,1,4,3,'guest_accounts','70bb992820e73638731aa8de79b3329e'), + ('eznode:14','eznode',1,29,0,0,1,6,3,'editors','a147e136bfa717592f2bd70bd4b53b17'), + ('nop:','nop',1,7,0,0,1,7,3,'administrator_users2','a7da338c20bf65f9f789c87296379c2a'), + ('eznode:13','eznode',1,27,0,0,1,5,3,'administrator_users','aeb8609aa933b0899aa012c71139c58c'), + ('eznode:44','eznode',1,30,0,0,1,10,3,'anonymous_users','e9e5ad0c05ee1a43715572e5cc545926'), + ('eznode:15','eznode',1,8,0,1,3,8,5,'Administrator-User','5a9d7b0ec93173ef4fedee023209cb61'), + ('eznode:15','eznode',1,28,0,0,0,8,7,'administrator_user','a3cca2de936df1e2f805710399989971'), + ('eznode:53','eznode',1,20,0,1,3,20,9,'Multimedia','2e5bc8831f7ae6a29530e7f1bbf2de9c'), + ('eznode:52','eznode',1,19,0,1,3,19,9,'Files','45b963397aa40d4a0063e0d85e4fe7a1'), + ('eznode:51','eznode',1,18,0,1,3,18,9,'Images','59b514174bffe4ae402b3d63aad79fe0'), + ('eznode:45','eznode',1,12,0,1,3,12,10,'Anonymous-User','ccb62ebca03a31272430bc414bd5cd5b'), + ('eznode:45','eznode',1,31,0,0,1,12,11,'anonymous_user','c593ec85293ecb0e02d50d4c5c6c20eb'), + ('eznode:53','eznode',1,34,0,0,1,20,17,'multimedia','2e5bc8831f7ae6a29530e7f1bbf2de9c'), + ('eznode:52','eznode',1,33,0,0,1,19,17,'files','45b963397aa40d4a0063e0d85e4fe7a1'), + ('eznode:51','eznode',1,32,0,0,1,18,17,'images','59b514174bffe4ae402b3d63aad79fe0'); +-- ibexa:sql-statement-separator +INSERT INTO `ezurlalias_ml_incr` (`id`) +VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15), (16), (17), + (18), (19), (20), (21), (22), (24), (25), (26), (27), (28), (29), (30), (31), (32), (33), + (34), (35), (36), (37); +-- ibexa:sql-statement-separator +INSERT INTO `ezuser` (`contentobject_id`, `email`, `login`, `password_hash`, `password_hash_type`) +VALUES (10,'anonymous@link.invalid','anonymous','$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',7), + (14,'admin@link.invalid','admin','$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',7); +-- ibexa:sql-statement-separator +INSERT INTO `ezuser_role` (`contentobject_id`, `id`, `limit_identifier`, `limit_value`, `role_id`) +VALUES (11,28,'','',1), + (42,31,'','',1), + (13,32,'Subtree','/1/2/',3), + (13,33,'Subtree','/1/43/',3), + (12,34,'','',2), + (13,35,'','',4); +-- ibexa:sql-statement-separator +INSERT INTO `ezuser_setting` (`is_enabled`, `max_login`, `user_id`) +VALUES (1,1000,10), + (1,10,14); +-- ibexa:sql-statement-separator +INSERT INTO `ezpreferences` (`name`, `user_id`, `value`) +SELECT 'focus_mode', u.contentobject_id, '0' FROM `ezuser` u WHERE u.login = 'admin'; diff --git a/src/bundle/RepositoryInstaller/Migration/sql/install-schema-mysql.sql b/src/bundle/RepositoryInstaller/Migration/sql/install-schema-mysql.sql new file mode 100644 index 0000000000..ce1affe2b3 --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/install-schema-mysql.sql @@ -0,0 +1,679 @@ +CREATE TABLE ezbinaryfile ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + download_count INT DEFAULT 0 NOT NULL, + filename VARCHAR(255) DEFAULT '' NOT NULL, + mime_type VARCHAR(255) DEFAULT '' NOT NULL, + original_filename VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_attribute_id, version) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state ( + id INT AUTO_INCREMENT NOT NULL, + default_language_id BIGINT DEFAULT 0 NOT NULL, + group_id INT DEFAULT 0 NOT NULL, + identifier VARCHAR(45) DEFAULT '' NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + priority INT DEFAULT 0 NOT NULL, + INDEX ezcobj_state_priority (priority), + INDEX ezcobj_state_lmask (language_mask), + UNIQUE INDEX ezcobj_state_identifier (group_id, identifier), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_group ( + id INT AUTO_INCREMENT NOT NULL, + default_language_id BIGINT DEFAULT 0 NOT NULL, + identifier VARCHAR(45) DEFAULT '' NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + INDEX ezcobj_state_group_lmask (language_mask), + UNIQUE INDEX ezcobj_state_group_identifier (identifier), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_group_language ( + contentobject_state_group_id INT DEFAULT 0 NOT NULL, + real_language_id BIGINT DEFAULT 0 NOT NULL, + description LONGTEXT NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + name VARCHAR(45) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_state_group_id, real_language_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_language ( + contentobject_state_id INT DEFAULT 0 NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + description LONGTEXT NOT NULL, + name VARCHAR(45) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_state_id, language_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_link ( + contentobject_id INT DEFAULT 0 NOT NULL, + contentobject_state_id INT DEFAULT 0 NOT NULL, + PRIMARY KEY(contentobject_id, contentobject_state_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontent_language ( + id BIGINT DEFAULT 0 NOT NULL, + disabled INT DEFAULT 0 NOT NULL, + locale VARCHAR(20) DEFAULT '' NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + INDEX ezcontent_language_name (name(191)), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezuser ( + contentobject_id INT DEFAULT 0 NOT NULL, + email VARCHAR(150) DEFAULT '' NOT NULL, + login VARCHAR(150) DEFAULT '' NOT NULL, + password_hash VARCHAR(255) DEFAULT NULL, + password_hash_type INT DEFAULT 1 NOT NULL, + password_updated_at INT DEFAULT NULL, + UNIQUE INDEX ezuser_login (login), + PRIMARY KEY(contentobject_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_tree ( + node_id INT AUTO_INCREMENT NOT NULL, + contentobject_id INT DEFAULT NULL, + contentobject_is_published INT DEFAULT NULL, + contentobject_version INT DEFAULT NULL, + depth INT DEFAULT 0 NOT NULL, + is_hidden INT DEFAULT 0 NOT NULL, + is_invisible INT DEFAULT 0 NOT NULL, + main_node_id INT DEFAULT NULL, + modified_subnode INT DEFAULT 0, + parent_node_id INT DEFAULT 0 NOT NULL, + path_identification_string LONGTEXT DEFAULT NULL, + path_string VARCHAR(255) DEFAULT '' NOT NULL, + priority INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + sort_field INT DEFAULT 1, + sort_order INT DEFAULT 1, + INDEX ezcontentobject_tree_p_node_id (parent_node_id), + INDEX ezcontentobject_tree_path_ident (path_identification_string(50)), + INDEX ezcontentobject_tree_contentobject_id_path_string (path_string(191), contentobject_id), + INDEX ezcontentobject_tree_co_id (contentobject_id), + INDEX ezcontentobject_tree_depth (depth), + INDEX ezcontentobject_tree_path (path_string(191)), + INDEX modified_subnode (modified_subnode), + INDEX ezcontentobject_tree_remote_id (remote_id), + PRIMARY KEY(node_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentbrowsebookmark ( + id INT AUTO_INCREMENT NOT NULL, + node_id INT DEFAULT 0 NOT NULL, + user_id INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + INDEX ezcontentbrowsebookmark_location (node_id), + INDEX ezcontentbrowsebookmark_user (user_id), + INDEX ezcontentbrowsebookmark_user_location (user_id, node_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass ( + id INT AUTO_INCREMENT NOT NULL, + version INT DEFAULT 0 NOT NULL, + always_available INT DEFAULT 0 NOT NULL, + contentobject_name VARCHAR(255) DEFAULT NULL, + created INT DEFAULT 0 NOT NULL, + creator_id INT DEFAULT 0 NOT NULL, + identifier VARCHAR(50) DEFAULT '' NOT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + is_container INT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + modifier_id INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + serialized_description_list LONGTEXT DEFAULT NULL, + serialized_name_list LONGTEXT DEFAULT NULL, + sort_field INT DEFAULT 1 NOT NULL, + sort_order INT DEFAULT 1 NOT NULL, + url_alias_name VARCHAR(255) DEFAULT NULL, + INDEX ezcontentclass_version (version), + INDEX ezcontentclass_identifier (identifier, version), + PRIMARY KEY(id, version) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_attribute ( + id INT AUTO_INCREMENT NOT NULL, + version INT DEFAULT 0 NOT NULL, + can_translate INT DEFAULT 1, + category VARCHAR(25) DEFAULT '' NOT NULL, + contentclass_id INT DEFAULT 0 NOT NULL, + data_float1 DOUBLE PRECISION DEFAULT NULL, + data_float2 DOUBLE PRECISION DEFAULT NULL, + data_float3 DOUBLE PRECISION DEFAULT NULL, + data_float4 DOUBLE PRECISION DEFAULT NULL, + data_int1 INT DEFAULT NULL, + data_int2 INT DEFAULT NULL, + data_int3 INT DEFAULT NULL, + data_int4 INT DEFAULT NULL, + data_text1 VARCHAR(255) DEFAULT NULL, + data_text2 VARCHAR(50) DEFAULT NULL, + data_text3 VARCHAR(50) DEFAULT NULL, + data_text4 VARCHAR(255) DEFAULT NULL, + data_text5 LONGTEXT DEFAULT NULL, + data_type_string VARCHAR(50) DEFAULT '' NOT NULL, + identifier VARCHAR(50) DEFAULT '' NOT NULL, + is_information_collector INT DEFAULT 0 NOT NULL, + is_required INT DEFAULT 0 NOT NULL, + is_searchable INT DEFAULT 0 NOT NULL, + is_thumbnail TINYINT(1) DEFAULT '0' NOT NULL, + placement INT DEFAULT 0 NOT NULL, + serialized_data_text LONGTEXT DEFAULT NULL, + serialized_description_list LONGTEXT DEFAULT NULL, + serialized_name_list LONGTEXT NOT NULL, + INDEX ezcontentclass_attr_ccid (contentclass_id), + INDEX ezcontentclass_attr_dts (data_type_string), + PRIMARY KEY(id, version) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_attribute_ml ( + contentclass_attribute_id INT NOT NULL, + version INT NOT NULL, + language_id BIGINT NOT NULL, + name VARCHAR(255) NOT NULL, + description TEXT DEFAULT NULL, + data_text TEXT DEFAULT NULL, + data_json TEXT DEFAULT NULL, + INDEX ezcontentclass_attribute_ml_lang_fk (language_id), + PRIMARY KEY(contentclass_attribute_id, version, language_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_classgroup ( + contentclass_id INT DEFAULT 0 NOT NULL, + contentclass_version INT DEFAULT 0 NOT NULL, + group_id INT DEFAULT 0 NOT NULL, + group_name VARCHAR(255) DEFAULT NULL, + PRIMARY KEY(contentclass_id, contentclass_version, group_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_name ( + contentclass_id INT DEFAULT 0 NOT NULL, + contentclass_version INT DEFAULT 0 NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + language_locale VARCHAR(20) DEFAULT '' NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(contentclass_id, contentclass_version, language_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclassgroup ( + id INT AUTO_INCREMENT NOT NULL, + created INT DEFAULT 0 NOT NULL, + creator_id INT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + modifier_id INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + is_system TINYINT(1) DEFAULT '0' NOT NULL, + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject ( + id INT AUTO_INCREMENT NOT NULL, + contentclass_id INT DEFAULT 0 NOT NULL, + current_version INT DEFAULT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + owner_id INT DEFAULT 0 NOT NULL, + published INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT NULL, + section_id INT DEFAULT 0 NOT NULL, + status INT DEFAULT 0, + is_hidden TINYINT(1) DEFAULT '0' NOT NULL, + INDEX ezcontentobject_classid (contentclass_id), + INDEX ezcontentobject_lmask (language_mask), + INDEX ezcontentobject_pub (published), + INDEX ezcontentobject_section (section_id), + INDEX ezcontentobject_currentversion (current_version), + INDEX ezcontentobject_owner (owner_id), + INDEX ezcontentobject_status (status), + UNIQUE INDEX ezcontentobject_remote_id (remote_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_attribute ( + id INT AUTO_INCREMENT NOT NULL, + version INT DEFAULT 0 NOT NULL, + attribute_original_id INT DEFAULT 0, + contentclassattribute_id INT DEFAULT 0 NOT NULL, + contentobject_id INT DEFAULT 0 NOT NULL, + data_float DOUBLE PRECISION DEFAULT NULL, + data_int INT DEFAULT NULL, + data_text LONGTEXT DEFAULT NULL, + data_type_string VARCHAR(50) DEFAULT '', + language_code VARCHAR(20) DEFAULT '' NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + sort_key_int INT DEFAULT 0 NOT NULL, + sort_key_string VARCHAR(255) DEFAULT '' NOT NULL, + INDEX ezcontentobject_attribute_co_id_ver_lang_code (contentobject_id, version, language_code), + INDEX ezcontentobject_classattr_id (contentclassattribute_id), + INDEX sort_key_string (sort_key_string(191)), + INDEX ezcontentobject_attribute_language_code (language_code), + INDEX sort_key_int (sort_key_int), + INDEX ezcontentobject_attribute_co_id_ver (contentobject_id, version), + PRIMARY KEY(id, version) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_link ( + id INT AUTO_INCREMENT NOT NULL, + contentclassattribute_id INT DEFAULT 0 NOT NULL, + from_contentobject_id INT DEFAULT 0 NOT NULL, + from_contentobject_version INT DEFAULT 0 NOT NULL, + relation_type INT DEFAULT 1 NOT NULL, + to_contentobject_id INT DEFAULT 0 NOT NULL, + INDEX ezco_link_to_co_id (to_contentobject_id), + INDEX ezco_link_from (from_contentobject_id, from_contentobject_version, contentclassattribute_id), + INDEX ezco_link_cca_id (contentclassattribute_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_name ( + contentobject_id INT DEFAULT 0 NOT NULL, + content_version INT DEFAULT 0 NOT NULL, + content_translation VARCHAR(20) DEFAULT '' NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + real_translation VARCHAR(20) DEFAULT NULL, + INDEX ezcontentobject_name_lang_id (language_id), + INDEX ezcontentobject_name_cov_id (content_version), + INDEX ezcontentobject_name_name (name(191)), + PRIMARY KEY(contentobject_id, content_version, content_translation) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_trash ( + node_id INT DEFAULT 0 NOT NULL, + contentobject_id INT DEFAULT NULL, + contentobject_version INT DEFAULT NULL, + depth INT DEFAULT 0 NOT NULL, + is_hidden INT DEFAULT 0 NOT NULL, + is_invisible INT DEFAULT 0 NOT NULL, + main_node_id INT DEFAULT NULL, + modified_subnode INT DEFAULT 0, + parent_node_id INT DEFAULT 0 NOT NULL, + path_identification_string LONGTEXT DEFAULT NULL, + path_string VARCHAR(255) DEFAULT '' NOT NULL, + priority INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + sort_field INT DEFAULT 1, + sort_order INT DEFAULT 1, + trashed INT DEFAULT 0 NOT NULL, + INDEX ezcobj_trash_depth (depth), + INDEX ezcobj_trash_p_node_id (parent_node_id), + INDEX ezcobj_trash_path_ident (path_identification_string(50)), + INDEX ezcobj_trash_co_id (contentobject_id), + INDEX ezcobj_trash_modified_subnode (modified_subnode), + INDEX ezcobj_trash_path (path_string(191)), + PRIMARY KEY(node_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_version ( + id INT AUTO_INCREMENT NOT NULL, + contentobject_id INT DEFAULT NULL, + created INT DEFAULT 0 NOT NULL, + creator_id INT DEFAULT 0 NOT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + status INT DEFAULT 0 NOT NULL, + user_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + workflow_event_pos INT DEFAULT 0, + INDEX ezcobj_version_status (status), + INDEX idx_object_version_objver (contentobject_id, version), + INDEX ezcontobj_version_obj_status (contentobject_id, status), + INDEX ezcobj_version_creator_id (creator_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezdfsfile ( + name_hash VARCHAR(34) DEFAULT '' NOT NULL, + name TEXT NOT NULL, + name_trunk TEXT NOT NULL, + datatype VARCHAR(255) DEFAULT 'application/octet-stream' NOT NULL, + scope VARCHAR(25) DEFAULT '' NOT NULL, + size BIGINT UNSIGNED DEFAULT 0 NOT NULL, + mtime INT DEFAULT 0 NOT NULL, + expired TINYINT(1) DEFAULT '0' NOT NULL, + status TINYINT(1) DEFAULT '0' NOT NULL, + INDEX ezdfsfile_name_trunk (name_trunk(191)), + INDEX ezdfsfile_expired_name (expired, name(191)), + INDEX ezdfsfile_name (name(191)), + INDEX ezdfsfile_mtime (mtime), + PRIMARY KEY(name_hash) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezgmaplocation ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + contentobject_version INT DEFAULT 0 NOT NULL, + latitude DOUBLE PRECISION DEFAULT '0' NOT NULL, + longitude DOUBLE PRECISION DEFAULT '0' NOT NULL, + address VARCHAR(150) DEFAULT NULL, + INDEX latitude_longitude_key (latitude, longitude), + PRIMARY KEY(contentobject_attribute_id, contentobject_version) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezimagefile ( + id INT AUTO_INCREMENT NOT NULL, + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + filepath LONGTEXT NOT NULL, + INDEX ezimagefile_file (filepath(191)), + INDEX ezimagefile_coid (contentobject_attribute_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezkeyword ( + id INT AUTO_INCREMENT NOT NULL, + class_id INT DEFAULT 0 NOT NULL, + keyword VARCHAR(255) DEFAULT NULL, + INDEX ezkeyword_keyword (keyword(191)), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezkeyword_attribute_link ( + id INT AUTO_INCREMENT NOT NULL, + keyword_id INT DEFAULT 0 NOT NULL, + objectattribute_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + INDEX ezkeyword_attr_link_oaid (objectattribute_id), + INDEX ezkeyword_attr_link_kid_oaid (keyword_id, objectattribute_id), + INDEX ezkeyword_attr_link_oaid_ver (objectattribute_id, version), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezmedia ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + controls VARCHAR(50) DEFAULT NULL, + filename VARCHAR(255) DEFAULT '' NOT NULL, + has_controller INT DEFAULT 0, + height INT DEFAULT NULL, + is_autoplay INT DEFAULT 0, + is_loop INT DEFAULT 0, + mime_type VARCHAR(50) DEFAULT '' NOT NULL, + original_filename VARCHAR(255) DEFAULT '' NOT NULL, + pluginspage VARCHAR(255) DEFAULT NULL, + quality VARCHAR(50) DEFAULT NULL, + width INT DEFAULT NULL, + PRIMARY KEY(contentobject_attribute_id, version) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE eznode_assignment ( + id INT AUTO_INCREMENT NOT NULL, + contentobject_id INT DEFAULT NULL, + contentobject_version INT DEFAULT NULL, + from_node_id INT DEFAULT 0, + is_main INT DEFAULT 0 NOT NULL, + op_code INT DEFAULT 0 NOT NULL, + parent_node INT DEFAULT NULL, + parent_remote_id VARCHAR(100) DEFAULT '' NOT NULL, + remote_id VARCHAR(100) DEFAULT '0' NOT NULL, + sort_field INT DEFAULT 1, + sort_order INT DEFAULT 1, + priority INT DEFAULT 0 NOT NULL, + is_hidden INT DEFAULT 0 NOT NULL, + INDEX eznode_assignment_is_main (is_main), + INDEX eznode_assignment_coid_cov (contentobject_id, contentobject_version), + INDEX eznode_assignment_parent_node (parent_node), + INDEX eznode_assignment_co_version (contentobject_version), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE eznotification ( + id INT AUTO_INCREMENT NOT NULL, + owner_id INT DEFAULT 0 NOT NULL, + is_pending TINYINT(1) DEFAULT '1' NOT NULL, + type VARCHAR(128) DEFAULT '' NOT NULL, + created INT DEFAULT 0 NOT NULL, + data LONGTEXT DEFAULT NULL, + INDEX eznotification_owner_is_pending (owner_id, is_pending), + INDEX eznotification_owner (owner_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezpackage ( + id INT AUTO_INCREMENT NOT NULL, + install_date INT DEFAULT 0 NOT NULL, + name VARCHAR(100) DEFAULT '' NOT NULL, + version VARCHAR(30) DEFAULT '0' NOT NULL, + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy ( + id INT AUTO_INCREMENT NOT NULL, + function_name VARCHAR(255) DEFAULT NULL, + module_name VARCHAR(255) DEFAULT NULL, + original_id INT DEFAULT 0 NOT NULL, + role_id INT DEFAULT NULL, + INDEX ezpolicy_role_id (role_id), + INDEX ezpolicy_original_id (original_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy_limitation ( + id INT AUTO_INCREMENT NOT NULL, + identifier VARCHAR(255) DEFAULT '' NOT NULL, + policy_id INT DEFAULT NULL, + INDEX policy_id (policy_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy_limitation_value ( + id INT AUTO_INCREMENT NOT NULL, + limitation_id INT DEFAULT NULL, + value VARCHAR(255) DEFAULT NULL, + INDEX ezpolicy_limit_value_limit_id (limitation_id), + INDEX ezpolicy_limitation_value_val (value(191)), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezpreferences ( + id INT AUTO_INCREMENT NOT NULL, + name VARCHAR(100) DEFAULT NULL, + user_id INT DEFAULT 0 NOT NULL, + value LONGTEXT DEFAULT NULL, + INDEX ezpreferences_user_id_idx (user_id, name), + INDEX ezpreferences_name (name), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezrole ( + id INT AUTO_INCREMENT NOT NULL, + is_new INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + value CHAR(1) DEFAULT NULL, + version INT DEFAULT 0, + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezsearch_object_word_link ( + id INT AUTO_INCREMENT NOT NULL, + contentclass_attribute_id INT DEFAULT 0 NOT NULL, + contentclass_id INT DEFAULT 0 NOT NULL, + contentobject_id INT DEFAULT 0 NOT NULL, + frequency DOUBLE PRECISION DEFAULT '0' NOT NULL, + identifier VARCHAR(255) DEFAULT '' NOT NULL, + integer_value INT DEFAULT 0 NOT NULL, + next_word_id INT DEFAULT 0 NOT NULL, + placement INT DEFAULT 0 NOT NULL, + prev_word_id INT DEFAULT 0 NOT NULL, + published INT DEFAULT 0 NOT NULL, + section_id INT DEFAULT 0 NOT NULL, + word_id INT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + INDEX ezsearch_object_word_link_object (contentobject_id), + INDEX ezsearch_object_word_link_identifier (identifier(191)), + INDEX ezsearch_object_word_link_integer_value (integer_value), + INDEX ezsearch_object_word_link_word (word_id), + INDEX ezsearch_object_word_link_frequency (frequency), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezsearch_word ( + id INT AUTO_INCREMENT NOT NULL, + object_count INT DEFAULT 0 NOT NULL, + word VARCHAR(150) DEFAULT NULL, + INDEX ezsearch_word_word_i (word), + INDEX ezsearch_word_obj_count (object_count), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezsection ( + id INT AUTO_INCREMENT NOT NULL, + identifier VARCHAR(255) DEFAULT NULL, + locale VARCHAR(255) DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + navigation_part_identifier VARCHAR(100) DEFAULT 'ezcontentnavigationpart', + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezsite_data ( + name VARCHAR(60) DEFAULT '' NOT NULL, + value LONGTEXT NOT NULL, + PRIMARY KEY(name) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezurl ( + id INT AUTO_INCREMENT NOT NULL, + created INT DEFAULT 0 NOT NULL, + is_valid INT DEFAULT 1 NOT NULL, + last_checked INT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + original_url_md5 VARCHAR(32) DEFAULT '' NOT NULL, + url LONGTEXT DEFAULT NULL, + INDEX ezurl_url (url(191)), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezurl_object_link ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + contentobject_attribute_version INT DEFAULT 0 NOT NULL, + url_id INT DEFAULT 0 NOT NULL, + INDEX ezurl_ol_coa_id (contentobject_attribute_id), + INDEX ezurl_ol_url_id (url_id), + INDEX ezurl_ol_coa_version (contentobject_attribute_version), + INDEX ezurl_ol_coa_id_cav (contentobject_attribute_id, contentobject_attribute_version) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias ( + id INT AUTO_INCREMENT NOT NULL, + destination_url LONGTEXT NOT NULL, + forward_to_id INT DEFAULT 0 NOT NULL, + is_imported INT DEFAULT 0 NOT NULL, + is_internal INT DEFAULT 1 NOT NULL, + is_wildcard INT DEFAULT 0 NOT NULL, + source_md5 VARCHAR(32) DEFAULT NULL, + source_url LONGTEXT NOT NULL, + INDEX ezurlalias_source_md5 (source_md5), + INDEX ezurlalias_wcard_fwd (is_wildcard, forward_to_id), + INDEX ezurlalias_forward_to_id (forward_to_id), + INDEX ezurlalias_imp_wcard_fwd (is_imported, is_wildcard, forward_to_id), + INDEX ezurlalias_source_url (source_url(191)), + INDEX ezurlalias_desturl (destination_url(191)), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias_ml ( + parent INT DEFAULT 0 NOT NULL, + text_md5 VARCHAR(32) DEFAULT '' NOT NULL, + action LONGTEXT NOT NULL, + action_type VARCHAR(32) DEFAULT '' NOT NULL, + alias_redirects INT DEFAULT 1 NOT NULL, + id INT DEFAULT 0 NOT NULL, + is_alias INT DEFAULT 0 NOT NULL, + is_original INT DEFAULT 0 NOT NULL, + lang_mask BIGINT DEFAULT 0 NOT NULL, + link INT DEFAULT 0 NOT NULL, + text LONGTEXT NOT NULL, + INDEX ezurlalias_ml_actt_org_al (action_type, is_original, is_alias), + INDEX ezurlalias_ml_text_lang (text(32), lang_mask, parent), + INDEX ezurlalias_ml_par_act_id_lnk (action(32), id, link, parent), + INDEX ezurlalias_ml_par_lnk_txt (parent, text(32), link), + INDEX ezurlalias_ml_act_org (action(32), is_original), + INDEX ezurlalias_ml_text (text(32), id, link), + INDEX ezurlalias_ml_link (link), + INDEX ezurlalias_ml_id (id), + PRIMARY KEY(parent, text_md5) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias_ml_incr ( + id INT AUTO_INCREMENT NOT NULL, + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezurlwildcard ( + id INT AUTO_INCREMENT NOT NULL, + destination_url LONGTEXT NOT NULL, + source_url LONGTEXT NOT NULL, + type INT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_accountkey ( + id INT AUTO_INCREMENT NOT NULL, + hash_key VARCHAR(32) DEFAULT '' NOT NULL, + time INT DEFAULT 0 NOT NULL, + user_id INT DEFAULT 0 NOT NULL, + INDEX hash_key (hash_key), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_role ( + id INT AUTO_INCREMENT NOT NULL, + contentobject_id INT DEFAULT NULL, + limit_identifier VARCHAR(255) DEFAULT '', + limit_value VARCHAR(255) DEFAULT '', + role_id INT DEFAULT NULL, + INDEX ezuser_role_role_id (role_id), + INDEX ezuser_role_contentobject_id (contentobject_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_setting ( + user_id INT DEFAULT 0 NOT NULL, + is_enabled INT DEFAULT 0 NOT NULL, + max_login INT DEFAULT NULL, + PRIMARY KEY(user_id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_setting ( + id INT AUTO_INCREMENT NOT NULL, + `group` VARCHAR(128) NOT NULL, + identifier VARCHAR(128) NOT NULL, + value JSON NOT NULL, + INDEX ibexa_setting_id (id), + UNIQUE INDEX ibexa_setting_group_identifier (`group`, identifier), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_token_type ( + id INT AUTO_INCREMENT NOT NULL, + identifier VARCHAR(64) NOT NULL, + UNIQUE INDEX ibexa_token_type_unique (identifier), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_token ( + id INT AUTO_INCREMENT NOT NULL, + type_id INT NOT NULL, + token VARCHAR(255) NOT NULL, + identifier VARCHAR(128) DEFAULT NULL, + created INT DEFAULT 0 NOT NULL, + expires INT DEFAULT 0 NOT NULL, + revoked TINYINT(1) DEFAULT '0' NOT NULL, + INDEX IDX_B5412887C54C8C93 (type_id), + UNIQUE INDEX ibexa_token_unique (token, identifier, type_id), + PRIMARY KEY(id) +) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB; +-- ibexa:sql-statement-separator +ALTER TABLE ezcontentbrowsebookmark ADD CONSTRAINT ezcontentbrowsebookmark_location_fk FOREIGN KEY (node_id) REFERENCES ezcontentobject_tree (node_id) ON UPDATE NO ACTION ON DELETE CASCADE; +-- ibexa:sql-statement-separator +ALTER TABLE ezcontentbrowsebookmark ADD CONSTRAINT ezcontentbrowsebookmark_user_fk FOREIGN KEY (user_id) REFERENCES ezuser (contentobject_id) ON UPDATE NO ACTION ON DELETE CASCADE; +-- ibexa:sql-statement-separator +ALTER TABLE ezcontentclass_attribute_ml ADD CONSTRAINT ezcontentclass_attribute_ml_lang_fk FOREIGN KEY (language_id) REFERENCES ezcontent_language (id) ON UPDATE CASCADE ON DELETE CASCADE; +-- ibexa:sql-statement-separator +ALTER TABLE ibexa_token ADD CONSTRAINT ibexa_token_type_id_fk FOREIGN KEY (type_id) REFERENCES ibexa_token_type (id) ON DELETE CASCADE; diff --git a/src/bundle/RepositoryInstaller/Migration/sql/install-schema-postgresql.sql b/src/bundle/RepositoryInstaller/Migration/sql/install-schema-postgresql.sql new file mode 100644 index 0000000000..eef2fa53ac --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/install-schema-postgresql.sql @@ -0,0 +1,790 @@ +CREATE TABLE ezbinaryfile ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + download_count INT DEFAULT 0 NOT NULL, + filename VARCHAR(255) DEFAULT '' NOT NULL, + mime_type VARCHAR(255) DEFAULT '' NOT NULL, + original_filename VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_attribute_id, version) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state ( + id SERIAL NOT NULL, + default_language_id BIGINT DEFAULT 0 NOT NULL, + group_id INT DEFAULT 0 NOT NULL, + identifier VARCHAR(45) DEFAULT '' NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + priority INT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_state_priority ON ezcobj_state (priority); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_state_lmask ON ezcobj_state (language_mask); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezcobj_state_identifier ON ezcobj_state (group_id, identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_group ( + id SERIAL NOT NULL, + default_language_id BIGINT DEFAULT 0 NOT NULL, + identifier VARCHAR(45) DEFAULT '' NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_state_group_lmask ON ezcobj_state_group (language_mask); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezcobj_state_group_identifier ON ezcobj_state_group (identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_group_language ( + contentobject_state_group_id INT DEFAULT 0 NOT NULL, + real_language_id BIGINT DEFAULT 0 NOT NULL, + description TEXT NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + name VARCHAR(45) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_state_group_id, real_language_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_language ( + contentobject_state_id INT DEFAULT 0 NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + description TEXT NOT NULL, + name VARCHAR(45) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_state_id, language_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_link ( + contentobject_id INT DEFAULT 0 NOT NULL, + contentobject_state_id INT DEFAULT 0 NOT NULL, + PRIMARY KEY(contentobject_id, contentobject_state_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontent_language ( + id BIGINT DEFAULT 0 NOT NULL, + disabled INT DEFAULT 0 NOT NULL, + locale VARCHAR(20) DEFAULT '' NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontent_language_name ON ezcontent_language (name); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser ( + contentobject_id INT DEFAULT 0 NOT NULL, + email VARCHAR(150) DEFAULT '' NOT NULL, + login VARCHAR(150) DEFAULT '' NOT NULL, + password_hash VARCHAR(255) DEFAULT NULL, + password_hash_type INT DEFAULT 1 NOT NULL, + password_updated_at INT DEFAULT NULL, + PRIMARY KEY(contentobject_id) +); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezuser_login ON ezuser (login); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_tree ( + node_id SERIAL NOT NULL, + contentobject_id INT DEFAULT NULL, + contentobject_is_published INT DEFAULT NULL, + contentobject_version INT DEFAULT NULL, + depth INT DEFAULT 0 NOT NULL, + is_hidden INT DEFAULT 0 NOT NULL, + is_invisible INT DEFAULT 0 NOT NULL, + main_node_id INT DEFAULT NULL, + modified_subnode INT DEFAULT 0, + parent_node_id INT DEFAULT 0 NOT NULL, + path_identification_string TEXT DEFAULT NULL, + path_string VARCHAR(255) DEFAULT '' NOT NULL, + priority INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + sort_field INT DEFAULT 1, + sort_order INT DEFAULT 1, + PRIMARY KEY(node_id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_p_node_id ON ezcontentobject_tree (parent_node_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_path_ident ON ezcontentobject_tree (path_identification_string); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_contentobject_id_path_string ON ezcontentobject_tree (path_string, contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_co_id ON ezcontentobject_tree (contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_depth ON ezcontentobject_tree (depth); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_path ON ezcontentobject_tree (path_string); +-- ibexa:sql-statement-separator +CREATE INDEX modified_subnode ON ezcontentobject_tree (modified_subnode); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_remote_id ON ezcontentobject_tree (remote_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentbrowsebookmark ( + id SERIAL NOT NULL, + node_id INT DEFAULT 0 NOT NULL, + user_id INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentbrowsebookmark_location ON ezcontentbrowsebookmark (node_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentbrowsebookmark_user ON ezcontentbrowsebookmark (user_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentbrowsebookmark_user_location ON ezcontentbrowsebookmark (user_id, node_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass ( + id SERIAL NOT NULL, + version INT DEFAULT 0 NOT NULL, + always_available INT DEFAULT 0 NOT NULL, + contentobject_name VARCHAR(255) DEFAULT NULL, + created INT DEFAULT 0 NOT NULL, + creator_id INT DEFAULT 0 NOT NULL, + identifier VARCHAR(50) DEFAULT '' NOT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + is_container INT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + modifier_id INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + serialized_description_list TEXT DEFAULT NULL, + serialized_name_list TEXT DEFAULT NULL, + sort_field INT DEFAULT 1 NOT NULL, + sort_order INT DEFAULT 1 NOT NULL, + url_alias_name VARCHAR(255) DEFAULT NULL, + PRIMARY KEY(id, version) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_version ON ezcontentclass (version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_identifier ON ezcontentclass (identifier, version); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_attribute ( + id SERIAL NOT NULL, + version INT DEFAULT 0 NOT NULL, + can_translate INT DEFAULT 1, + category VARCHAR(25) DEFAULT '' NOT NULL, + contentclass_id INT DEFAULT 0 NOT NULL, + data_float1 DOUBLE PRECISION DEFAULT NULL, + data_float2 DOUBLE PRECISION DEFAULT NULL, + data_float3 DOUBLE PRECISION DEFAULT NULL, + data_float4 DOUBLE PRECISION DEFAULT NULL, + data_int1 INT DEFAULT NULL, + data_int2 INT DEFAULT NULL, + data_int3 INT DEFAULT NULL, + data_int4 INT DEFAULT NULL, + data_text1 VARCHAR(255) DEFAULT NULL, + data_text2 VARCHAR(50) DEFAULT NULL, + data_text3 VARCHAR(50) DEFAULT NULL, + data_text4 VARCHAR(255) DEFAULT NULL, + data_text5 TEXT DEFAULT NULL, + data_type_string VARCHAR(50) DEFAULT '' NOT NULL, + identifier VARCHAR(50) DEFAULT '' NOT NULL, + is_information_collector INT DEFAULT 0 NOT NULL, + is_required INT DEFAULT 0 NOT NULL, + is_searchable INT DEFAULT 0 NOT NULL, + is_thumbnail BOOLEAN DEFAULT 'false' NOT NULL, + placement INT DEFAULT 0 NOT NULL, + serialized_data_text TEXT DEFAULT NULL, + serialized_description_list TEXT DEFAULT NULL, + serialized_name_list TEXT NOT NULL, + PRIMARY KEY(id, version) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_attr_ccid ON ezcontentclass_attribute (contentclass_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_attr_dts ON ezcontentclass_attribute (data_type_string); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_attribute_ml ( + contentclass_attribute_id INT NOT NULL, + version INT NOT NULL, + language_id BIGINT NOT NULL, + name VARCHAR(255) NOT NULL, + description TEXT DEFAULT NULL, + data_text TEXT DEFAULT NULL, + data_json TEXT DEFAULT NULL, + PRIMARY KEY(contentclass_attribute_id, version, language_id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_attribute_ml_lang_fk ON ezcontentclass_attribute_ml (language_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_classgroup ( + contentclass_id INT DEFAULT 0 NOT NULL, + contentclass_version INT DEFAULT 0 NOT NULL, + group_id INT DEFAULT 0 NOT NULL, + group_name VARCHAR(255) DEFAULT NULL, + PRIMARY KEY(contentclass_id, contentclass_version, group_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_name ( + contentclass_id INT DEFAULT 0 NOT NULL, + contentclass_version INT DEFAULT 0 NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + language_locale VARCHAR(20) DEFAULT '' NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(contentclass_id, contentclass_version, language_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclassgroup ( + id SERIAL NOT NULL, + created INT DEFAULT 0 NOT NULL, + creator_id INT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + modifier_id INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + is_system BOOLEAN DEFAULT 'false' NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject ( + id SERIAL NOT NULL, + contentclass_id INT DEFAULT 0 NOT NULL, + current_version INT DEFAULT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + owner_id INT DEFAULT 0 NOT NULL, + published INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT NULL, + section_id INT DEFAULT 0 NOT NULL, + status INT DEFAULT 0, + is_hidden BOOLEAN DEFAULT 'false' NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_classid ON ezcontentobject (contentclass_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_lmask ON ezcontentobject (language_mask); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_pub ON ezcontentobject (published); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_section ON ezcontentobject (section_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_currentversion ON ezcontentobject (current_version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_owner ON ezcontentobject (owner_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_status ON ezcontentobject (status); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezcontentobject_remote_id ON ezcontentobject (remote_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_attribute ( + id SERIAL NOT NULL, + version INT DEFAULT 0 NOT NULL, + attribute_original_id INT DEFAULT 0, + contentclassattribute_id INT DEFAULT 0 NOT NULL, + contentobject_id INT DEFAULT 0 NOT NULL, + data_float DOUBLE PRECISION DEFAULT NULL, + data_int INT DEFAULT NULL, + data_text TEXT DEFAULT NULL, + data_type_string VARCHAR(50) DEFAULT '', + language_code VARCHAR(20) DEFAULT '' NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + sort_key_int INT DEFAULT 0 NOT NULL, + sort_key_string VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(id, version) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_attribute_co_id_ver_lang_code ON ezcontentobject_attribute (contentobject_id, version, language_code); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_classattr_id ON ezcontentobject_attribute (contentclassattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX sort_key_string ON ezcontentobject_attribute (sort_key_string); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_attribute_language_code ON ezcontentobject_attribute (language_code); +-- ibexa:sql-statement-separator +CREATE INDEX sort_key_int ON ezcontentobject_attribute (sort_key_int); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_attribute_co_id_ver ON ezcontentobject_attribute (contentobject_id, version); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_link ( + id SERIAL NOT NULL, + contentclassattribute_id INT DEFAULT 0 NOT NULL, + from_contentobject_id INT DEFAULT 0 NOT NULL, + from_contentobject_version INT DEFAULT 0 NOT NULL, + relation_type INT DEFAULT 1 NOT NULL, + to_contentobject_id INT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezco_link_to_co_id ON ezcontentobject_link (to_contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezco_link_from ON ezcontentobject_link (from_contentobject_id, from_contentobject_version, contentclassattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezco_link_cca_id ON ezcontentobject_link (contentclassattribute_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_name ( + contentobject_id INT DEFAULT 0 NOT NULL, + content_version INT DEFAULT 0 NOT NULL, + content_translation VARCHAR(20) DEFAULT '' NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + real_translation VARCHAR(20) DEFAULT NULL, + PRIMARY KEY(contentobject_id, content_version, content_translation) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_name_lang_id ON ezcontentobject_name (language_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_name_cov_id ON ezcontentobject_name (content_version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_name_name ON ezcontentobject_name (name); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_trash ( + node_id INT DEFAULT 0 NOT NULL, + contentobject_id INT DEFAULT NULL, + contentobject_version INT DEFAULT NULL, + depth INT DEFAULT 0 NOT NULL, + is_hidden INT DEFAULT 0 NOT NULL, + is_invisible INT DEFAULT 0 NOT NULL, + main_node_id INT DEFAULT NULL, + modified_subnode INT DEFAULT 0, + parent_node_id INT DEFAULT 0 NOT NULL, + path_identification_string TEXT DEFAULT NULL, + path_string VARCHAR(255) DEFAULT '' NOT NULL, + priority INT DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + sort_field INT DEFAULT 1, + sort_order INT DEFAULT 1, + trashed INT DEFAULT 0 NOT NULL, + PRIMARY KEY(node_id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_depth ON ezcontentobject_trash (depth); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_p_node_id ON ezcontentobject_trash (parent_node_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_path_ident ON ezcontentobject_trash (path_identification_string); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_co_id ON ezcontentobject_trash (contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_modified_subnode ON ezcontentobject_trash (modified_subnode); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_path ON ezcontentobject_trash (path_string); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_version ( + id SERIAL NOT NULL, + contentobject_id INT DEFAULT NULL, + created INT DEFAULT 0 NOT NULL, + creator_id INT DEFAULT 0 NOT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + status INT DEFAULT 0 NOT NULL, + user_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + workflow_event_pos INT DEFAULT 0, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_version_status ON ezcontentobject_version (status); +-- ibexa:sql-statement-separator +CREATE INDEX idx_object_version_objver ON ezcontentobject_version (contentobject_id, version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontobj_version_obj_status ON ezcontentobject_version (contentobject_id, status); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_version_creator_id ON ezcontentobject_version (creator_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezdfsfile ( + name_hash VARCHAR(34) DEFAULT '' NOT NULL, + name TEXT NOT NULL, + name_trunk TEXT NOT NULL, + datatype VARCHAR(255) DEFAULT 'application/octet-stream' NOT NULL, + scope VARCHAR(25) DEFAULT '' NOT NULL, + size BIGINT DEFAULT 0 NOT NULL, + mtime INT DEFAULT 0 NOT NULL, + expired BOOLEAN DEFAULT 'false' NOT NULL, + status BOOLEAN DEFAULT 'false' NOT NULL, + PRIMARY KEY(name_hash) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_name_trunk ON ezdfsfile (name_trunk); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_expired_name ON ezdfsfile (expired, name); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_name ON ezdfsfile (name); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_mtime ON ezdfsfile (mtime); +-- ibexa:sql-statement-separator +CREATE TABLE ezgmaplocation ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + contentobject_version INT DEFAULT 0 NOT NULL, + latitude DOUBLE PRECISION DEFAULT '0' NOT NULL, + longitude DOUBLE PRECISION DEFAULT '0' NOT NULL, + address VARCHAR(150) DEFAULT NULL, + PRIMARY KEY(contentobject_attribute_id, contentobject_version) +); +-- ibexa:sql-statement-separator +CREATE INDEX latitude_longitude_key ON ezgmaplocation (latitude, longitude); +-- ibexa:sql-statement-separator +CREATE TABLE ezimagefile ( + id SERIAL NOT NULL, + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + filepath TEXT NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezimagefile_file ON ezimagefile (filepath); +-- ibexa:sql-statement-separator +CREATE INDEX ezimagefile_coid ON ezimagefile (contentobject_attribute_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezkeyword ( + id SERIAL NOT NULL, + class_id INT DEFAULT 0 NOT NULL, + keyword VARCHAR(255) DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_keyword ON ezkeyword (keyword); +-- ibexa:sql-statement-separator +CREATE TABLE ezkeyword_attribute_link ( + id SERIAL NOT NULL, + keyword_id INT DEFAULT 0 NOT NULL, + objectattribute_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_attr_link_oaid ON ezkeyword_attribute_link (objectattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_attr_link_kid_oaid ON ezkeyword_attribute_link (keyword_id, objectattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_attr_link_oaid_ver ON ezkeyword_attribute_link (objectattribute_id, version); +-- ibexa:sql-statement-separator +CREATE TABLE ezmedia ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + version INT DEFAULT 0 NOT NULL, + controls VARCHAR(50) DEFAULT NULL, + filename VARCHAR(255) DEFAULT '' NOT NULL, + has_controller INT DEFAULT 0, + height INT DEFAULT NULL, + is_autoplay INT DEFAULT 0, + is_loop INT DEFAULT 0, + mime_type VARCHAR(50) DEFAULT '' NOT NULL, + original_filename VARCHAR(255) DEFAULT '' NOT NULL, + pluginspage VARCHAR(255) DEFAULT NULL, + quality VARCHAR(50) DEFAULT NULL, + width INT DEFAULT NULL, + PRIMARY KEY(contentobject_attribute_id, version) +); +-- ibexa:sql-statement-separator +CREATE TABLE eznode_assignment ( + id SERIAL NOT NULL, + contentobject_id INT DEFAULT NULL, + contentobject_version INT DEFAULT NULL, + from_node_id INT DEFAULT 0, + is_main INT DEFAULT 0 NOT NULL, + op_code INT DEFAULT 0 NOT NULL, + parent_node INT DEFAULT NULL, + parent_remote_id VARCHAR(100) DEFAULT '' NOT NULL, + remote_id VARCHAR(100) DEFAULT '0' NOT NULL, + sort_field INT DEFAULT 1, + sort_order INT DEFAULT 1, + priority INT DEFAULT 0 NOT NULL, + is_hidden INT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_is_main ON eznode_assignment (is_main); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_coid_cov ON eznode_assignment (contentobject_id, contentobject_version); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_parent_node ON eznode_assignment (parent_node); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_co_version ON eznode_assignment (contentobject_version); +-- ibexa:sql-statement-separator +CREATE TABLE eznotification ( + id SERIAL NOT NULL, + owner_id INT DEFAULT 0 NOT NULL, + is_pending BOOLEAN DEFAULT 'true' NOT NULL, + type VARCHAR(128) DEFAULT '' NOT NULL, + created INT DEFAULT 0 NOT NULL, + data TEXT DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX eznotification_owner_is_pending ON eznotification (owner_id, is_pending); +-- ibexa:sql-statement-separator +CREATE INDEX eznotification_owner ON eznotification (owner_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezpackage ( + id SERIAL NOT NULL, + install_date INT DEFAULT 0 NOT NULL, + name VARCHAR(100) DEFAULT '' NOT NULL, + version VARCHAR(30) DEFAULT '0' NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy ( + id SERIAL NOT NULL, + function_name VARCHAR(255) DEFAULT NULL, + module_name VARCHAR(255) DEFAULT NULL, + original_id INT DEFAULT 0 NOT NULL, + role_id INT DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_role_id ON ezpolicy (role_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_original_id ON ezpolicy (original_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy_limitation ( + id SERIAL NOT NULL, + identifier VARCHAR(255) DEFAULT '' NOT NULL, + policy_id INT DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX policy_id ON ezpolicy_limitation (policy_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy_limitation_value ( + id SERIAL NOT NULL, + limitation_id INT DEFAULT NULL, + value VARCHAR(255) DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_limit_value_limit_id ON ezpolicy_limitation_value (limitation_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_limitation_value_val ON ezpolicy_limitation_value (value); +-- ibexa:sql-statement-separator +CREATE TABLE ezpreferences ( + id SERIAL NOT NULL, + name VARCHAR(100) DEFAULT NULL, + user_id INT DEFAULT 0 NOT NULL, + value TEXT DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezpreferences_user_id_idx ON ezpreferences (user_id, name); +-- ibexa:sql-statement-separator +CREATE INDEX ezpreferences_name ON ezpreferences (name); +-- ibexa:sql-statement-separator +CREATE TABLE ezrole ( + id SERIAL NOT NULL, + is_new INT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + value CHAR(1) DEFAULT NULL, + version INT DEFAULT 0, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezsearch_object_word_link ( + id SERIAL NOT NULL, + contentclass_attribute_id INT DEFAULT 0 NOT NULL, + contentclass_id INT DEFAULT 0 NOT NULL, + contentobject_id INT DEFAULT 0 NOT NULL, + frequency DOUBLE PRECISION DEFAULT '0' NOT NULL, + identifier VARCHAR(255) DEFAULT '' NOT NULL, + integer_value INT DEFAULT 0 NOT NULL, + next_word_id INT DEFAULT 0 NOT NULL, + placement INT DEFAULT 0 NOT NULL, + prev_word_id INT DEFAULT 0 NOT NULL, + published INT DEFAULT 0 NOT NULL, + section_id INT DEFAULT 0 NOT NULL, + word_id INT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_object ON ezsearch_object_word_link (contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_identifier ON ezsearch_object_word_link (identifier); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_integer_value ON ezsearch_object_word_link (integer_value); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_word ON ezsearch_object_word_link (word_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_frequency ON ezsearch_object_word_link (frequency); +-- ibexa:sql-statement-separator +CREATE TABLE ezsearch_word ( + id SERIAL NOT NULL, + object_count INT DEFAULT 0 NOT NULL, + word VARCHAR(150) DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_word_word_i ON ezsearch_word (word); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_word_obj_count ON ezsearch_word (object_count); +-- ibexa:sql-statement-separator +CREATE TABLE ezsection ( + id SERIAL NOT NULL, + identifier VARCHAR(255) DEFAULT NULL, + locale VARCHAR(255) DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + navigation_part_identifier VARCHAR(100) DEFAULT 'ezcontentnavigationpart', + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezsite_data ( + name VARCHAR(60) DEFAULT '' NOT NULL, + value TEXT NOT NULL, + PRIMARY KEY(name) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezurl ( + id SERIAL NOT NULL, + created INT DEFAULT 0 NOT NULL, + is_valid INT DEFAULT 1 NOT NULL, + last_checked INT DEFAULT 0 NOT NULL, + modified INT DEFAULT 0 NOT NULL, + original_url_md5 VARCHAR(32) DEFAULT '' NOT NULL, + url TEXT DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_url ON ezurl (url); +-- ibexa:sql-statement-separator +CREATE TABLE ezurl_object_link ( + contentobject_attribute_id INT DEFAULT 0 NOT NULL, + contentobject_attribute_version INT DEFAULT 0 NOT NULL, + url_id INT DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_coa_id ON ezurl_object_link (contentobject_attribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_url_id ON ezurl_object_link (url_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_coa_version ON ezurl_object_link (contentobject_attribute_version); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_coa_id_cav ON ezurl_object_link (contentobject_attribute_id, contentobject_attribute_version); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias ( + id SERIAL NOT NULL, + destination_url TEXT NOT NULL, + forward_to_id INT DEFAULT 0 NOT NULL, + is_imported INT DEFAULT 0 NOT NULL, + is_internal INT DEFAULT 1 NOT NULL, + is_wildcard INT DEFAULT 0 NOT NULL, + source_md5 VARCHAR(32) DEFAULT NULL, + source_url TEXT NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_source_md5 ON ezurlalias (source_md5); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_wcard_fwd ON ezurlalias (is_wildcard, forward_to_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_forward_to_id ON ezurlalias (forward_to_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_imp_wcard_fwd ON ezurlalias (is_imported, is_wildcard, forward_to_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_source_url ON ezurlalias (source_url); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_desturl ON ezurlalias (destination_url); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias_ml ( + parent INT DEFAULT 0 NOT NULL, + text_md5 VARCHAR(32) DEFAULT '' NOT NULL, + action TEXT NOT NULL, + action_type VARCHAR(32) DEFAULT '' NOT NULL, + alias_redirects INT DEFAULT 1 NOT NULL, + id INT DEFAULT 0 NOT NULL, + is_alias INT DEFAULT 0 NOT NULL, + is_original INT DEFAULT 0 NOT NULL, + lang_mask BIGINT DEFAULT 0 NOT NULL, + link INT DEFAULT 0 NOT NULL, + text TEXT NOT NULL, + PRIMARY KEY(parent, text_md5) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_actt_org_al ON ezurlalias_ml (action_type, is_original, is_alias); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_text_lang ON ezurlalias_ml (text, lang_mask, parent); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_par_act_id_lnk ON ezurlalias_ml (action, id, link, parent); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_par_lnk_txt ON ezurlalias_ml (parent, text, link); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_act_org ON ezurlalias_ml (action, is_original); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_text ON ezurlalias_ml (text, id, link); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_link ON ezurlalias_ml (link); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_id ON ezurlalias_ml (id); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias_ml_incr ( + id SERIAL NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlwildcard ( + id SERIAL NOT NULL, + destination_url TEXT NOT NULL, + source_url TEXT NOT NULL, + type INT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_accountkey ( + id SERIAL NOT NULL, + hash_key VARCHAR(32) DEFAULT '' NOT NULL, + time INT DEFAULT 0 NOT NULL, + user_id INT DEFAULT 0 NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX hash_key ON ezuser_accountkey (hash_key); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_role ( + id SERIAL NOT NULL, + contentobject_id INT DEFAULT NULL, + limit_identifier VARCHAR(255) DEFAULT '', + limit_value VARCHAR(255) DEFAULT '', + role_id INT DEFAULT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezuser_role_role_id ON ezuser_role (role_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezuser_role_contentobject_id ON ezuser_role (contentobject_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_setting ( + user_id INT DEFAULT 0 NOT NULL, + is_enabled INT DEFAULT 0 NOT NULL, + max_login INT DEFAULT NULL, + PRIMARY KEY(user_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_setting ( + id SERIAL NOT NULL, + "group" VARCHAR(128) NOT NULL, + identifier VARCHAR(128) NOT NULL, + value JSON NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ibexa_setting_id ON ibexa_setting (id); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ibexa_setting_group_identifier ON ibexa_setting ("group", identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_token_type ( + id SERIAL NOT NULL, + identifier VARCHAR(64) NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ibexa_token_type_unique ON ibexa_token_type (identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_token ( + id SERIAL NOT NULL, + type_id INT NOT NULL, + token VARCHAR(255) NOT NULL, + identifier VARCHAR(128) DEFAULT NULL, + created INT DEFAULT 0 NOT NULL, + expires INT DEFAULT 0 NOT NULL, + revoked BOOLEAN DEFAULT 'false' NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX IDX_B5412887C54C8C93 ON ibexa_token (type_id); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ibexa_token_unique ON ibexa_token (token, identifier, type_id); +-- ibexa:sql-statement-separator +ALTER TABLE ezcontentbrowsebookmark ADD CONSTRAINT ezcontentbrowsebookmark_location_fk FOREIGN KEY (node_id) REFERENCES ezcontentobject_tree (node_id) ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE; +-- ibexa:sql-statement-separator +ALTER TABLE ezcontentbrowsebookmark ADD CONSTRAINT ezcontentbrowsebookmark_user_fk FOREIGN KEY (user_id) REFERENCES ezuser (contentobject_id) ON UPDATE NO ACTION ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE; +-- ibexa:sql-statement-separator +ALTER TABLE ezcontentclass_attribute_ml ADD CONSTRAINT ezcontentclass_attribute_ml_lang_fk FOREIGN KEY (language_id) REFERENCES ezcontent_language (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE; +-- ibexa:sql-statement-separator +ALTER TABLE ibexa_token ADD CONSTRAINT ibexa_token_type_id_fk FOREIGN KEY (type_id) REFERENCES ibexa_token_type (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE; diff --git a/src/bundle/RepositoryInstaller/Migration/sql/install-schema-sqlite.sql b/src/bundle/RepositoryInstaller/Migration/sql/install-schema-sqlite.sql new file mode 100644 index 0000000000..899b6cf872 --- /dev/null +++ b/src/bundle/RepositoryInstaller/Migration/sql/install-schema-sqlite.sql @@ -0,0 +1,755 @@ +CREATE TABLE ezbinaryfile ( + contentobject_attribute_id INTEGER DEFAULT 0 NOT NULL, + version INTEGER DEFAULT 0 NOT NULL, + download_count INTEGER DEFAULT 0 NOT NULL, + filename VARCHAR(255) DEFAULT '' NOT NULL, + mime_type VARCHAR(255) DEFAULT '' NOT NULL, + original_filename VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_attribute_id, version) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + default_language_id BIGINT DEFAULT 0 NOT NULL, + group_id INTEGER DEFAULT 0 NOT NULL, + identifier VARCHAR(45) DEFAULT '' NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + priority INTEGER DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_state_priority ON ezcobj_state (priority); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_state_lmask ON ezcobj_state (language_mask); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezcobj_state_identifier ON ezcobj_state (group_id, identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_group ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + default_language_id BIGINT DEFAULT 0 NOT NULL, + identifier VARCHAR(45) DEFAULT '' NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_state_group_lmask ON ezcobj_state_group (language_mask); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezcobj_state_group_identifier ON ezcobj_state_group (identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_group_language ( + contentobject_state_group_id INTEGER DEFAULT 0 NOT NULL, + real_language_id BIGINT DEFAULT 0 NOT NULL, + description CLOB NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + name VARCHAR(45) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_state_group_id, real_language_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_language ( + contentobject_state_id INTEGER DEFAULT 0 NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + description CLOB NOT NULL, + name VARCHAR(45) DEFAULT '' NOT NULL, + PRIMARY KEY(contentobject_state_id, language_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcobj_state_link ( + contentobject_id INTEGER DEFAULT 0 NOT NULL, + contentobject_state_id INTEGER DEFAULT 0 NOT NULL, + PRIMARY KEY(contentobject_id, contentobject_state_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontent_language ( + id BIGINT DEFAULT 0 NOT NULL, + disabled INTEGER DEFAULT 0 NOT NULL, + locale VARCHAR(20) DEFAULT '' NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontent_language_name ON ezcontent_language (name); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser ( + contentobject_id INTEGER DEFAULT 0 NOT NULL, + email VARCHAR(150) DEFAULT '' NOT NULL, + login VARCHAR(150) DEFAULT '' NOT NULL, + password_hash VARCHAR(255) DEFAULT NULL, + password_hash_type INTEGER DEFAULT 1 NOT NULL, + password_updated_at INTEGER DEFAULT NULL, + PRIMARY KEY(contentobject_id) +); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezuser_login ON ezuser (login); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_tree ( + node_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentobject_id INTEGER DEFAULT NULL, + contentobject_is_published INTEGER DEFAULT NULL, + contentobject_version INTEGER DEFAULT NULL, + depth INTEGER DEFAULT 0 NOT NULL, + is_hidden INTEGER DEFAULT 0 NOT NULL, + is_invisible INTEGER DEFAULT 0 NOT NULL, + main_node_id INTEGER DEFAULT NULL, + modified_subnode INTEGER DEFAULT 0, + parent_node_id INTEGER DEFAULT 0 NOT NULL, + path_identification_string CLOB DEFAULT NULL, + path_string VARCHAR(255) DEFAULT '' NOT NULL, + priority INTEGER DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + sort_field INTEGER DEFAULT 1, + sort_order INTEGER DEFAULT 1 +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_p_node_id ON ezcontentobject_tree (parent_node_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_path_ident ON ezcontentobject_tree (path_identification_string); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_contentobject_id_path_string ON ezcontentobject_tree (path_string, contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_co_id ON ezcontentobject_tree (contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_depth ON ezcontentobject_tree (depth); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_path ON ezcontentobject_tree (path_string); +-- ibexa:sql-statement-separator +CREATE INDEX modified_subnode ON ezcontentobject_tree (modified_subnode); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_tree_remote_id ON ezcontentobject_tree (remote_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentbrowsebookmark ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + node_id INTEGER DEFAULT 0 NOT NULL, + user_id INTEGER DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + CONSTRAINT ezcontentbrowsebookmark_location_fk FOREIGN KEY (node_id) REFERENCES ezcontentobject_tree (node_id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE, + CONSTRAINT ezcontentbrowsebookmark_user_fk FOREIGN KEY (user_id) REFERENCES ezuser (contentobject_id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentbrowsebookmark_location ON ezcontentbrowsebookmark (node_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentbrowsebookmark_user ON ezcontentbrowsebookmark (user_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentbrowsebookmark_user_location ON ezcontentbrowsebookmark (user_id, node_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass ( + id INTEGER NOT NULL, + version INTEGER DEFAULT 0 NOT NULL, + always_available INTEGER DEFAULT 0 NOT NULL, + contentobject_name VARCHAR(255) DEFAULT NULL, + created INTEGER DEFAULT 0 NOT NULL, + creator_id INTEGER DEFAULT 0 NOT NULL, + identifier VARCHAR(50) DEFAULT '' NOT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + is_container INTEGER DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INTEGER DEFAULT 0 NOT NULL, + modifier_id INTEGER DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + serialized_description_list CLOB DEFAULT NULL, + serialized_name_list CLOB DEFAULT NULL, + sort_field INTEGER DEFAULT 1 NOT NULL, + sort_order INTEGER DEFAULT 1 NOT NULL, + url_alias_name VARCHAR(255) DEFAULT NULL, + PRIMARY KEY(id, version) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_version ON ezcontentclass (version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_identifier ON ezcontentclass (identifier, version); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_attribute ( + id INTEGER NOT NULL, + version INTEGER DEFAULT 0 NOT NULL, + can_translate INTEGER DEFAULT 1, + category VARCHAR(25) DEFAULT '' NOT NULL, + contentclass_id INTEGER DEFAULT 0 NOT NULL, + data_float1 DOUBLE PRECISION DEFAULT NULL, + data_float2 DOUBLE PRECISION DEFAULT NULL, + data_float3 DOUBLE PRECISION DEFAULT NULL, + data_float4 DOUBLE PRECISION DEFAULT NULL, + data_int1 INTEGER DEFAULT NULL, + data_int2 INTEGER DEFAULT NULL, + data_int3 INTEGER DEFAULT NULL, + data_int4 INTEGER DEFAULT NULL, + data_text1 VARCHAR(255) DEFAULT NULL, + data_text2 VARCHAR(50) DEFAULT NULL, + data_text3 VARCHAR(50) DEFAULT NULL, + data_text4 VARCHAR(255) DEFAULT NULL, + data_text5 CLOB DEFAULT NULL, + data_type_string VARCHAR(50) DEFAULT '' NOT NULL, + identifier VARCHAR(50) DEFAULT '' NOT NULL, + is_information_collector INTEGER DEFAULT 0 NOT NULL, + is_required INTEGER DEFAULT 0 NOT NULL, + is_searchable INTEGER DEFAULT 0 NOT NULL, + is_thumbnail BOOLEAN DEFAULT '0' NOT NULL, + placement INTEGER DEFAULT 0 NOT NULL, + serialized_data_text CLOB DEFAULT NULL, + serialized_description_list CLOB DEFAULT NULL, + serialized_name_list CLOB NOT NULL, + PRIMARY KEY(id, version) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_attr_ccid ON ezcontentclass_attribute (contentclass_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_attr_dts ON ezcontentclass_attribute (data_type_string); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_attribute_ml ( + contentclass_attribute_id INTEGER NOT NULL, + version INTEGER NOT NULL, + language_id BIGINT NOT NULL, + name VARCHAR(255) NOT NULL, + description CLOB DEFAULT NULL, + data_text CLOB DEFAULT NULL, + data_json CLOB DEFAULT NULL, + PRIMARY KEY(contentclass_attribute_id, version, language_id), + CONSTRAINT ezcontentclass_attribute_ml_lang_fk FOREIGN KEY (language_id) REFERENCES ezcontent_language (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentclass_attribute_ml_lang_fk ON ezcontentclass_attribute_ml (language_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_classgroup ( + contentclass_id INTEGER DEFAULT 0 NOT NULL, + contentclass_version INTEGER DEFAULT 0 NOT NULL, + group_id INTEGER DEFAULT 0 NOT NULL, + group_name VARCHAR(255) DEFAULT NULL, + PRIMARY KEY(contentclass_id, contentclass_version, group_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclass_name ( + contentclass_id INTEGER DEFAULT 0 NOT NULL, + contentclass_version INTEGER DEFAULT 0 NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + language_locale VARCHAR(20) DEFAULT '' NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(contentclass_id, contentclass_version, language_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentclassgroup ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + created INTEGER DEFAULT 0 NOT NULL, + creator_id INTEGER DEFAULT 0 NOT NULL, + modified INTEGER DEFAULT 0 NOT NULL, + modifier_id INTEGER DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + is_system BOOLEAN DEFAULT '0' NOT NULL +); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentclass_id INTEGER DEFAULT 0 NOT NULL, + current_version INTEGER DEFAULT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INTEGER DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + owner_id INTEGER DEFAULT 0 NOT NULL, + published INTEGER DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT NULL, + section_id INTEGER DEFAULT 0 NOT NULL, + status INTEGER DEFAULT 0, + is_hidden BOOLEAN DEFAULT '0' NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_classid ON ezcontentobject (contentclass_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_lmask ON ezcontentobject (language_mask); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_pub ON ezcontentobject (published); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_section ON ezcontentobject (section_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_currentversion ON ezcontentobject (current_version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_owner ON ezcontentobject (owner_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_status ON ezcontentobject (status); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ezcontentobject_remote_id ON ezcontentobject (remote_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_attribute ( + id INTEGER NOT NULL, + version INTEGER DEFAULT 0 NOT NULL, + attribute_original_id INTEGER DEFAULT 0, + contentclassattribute_id INTEGER DEFAULT 0 NOT NULL, + contentobject_id INTEGER DEFAULT 0 NOT NULL, + data_float DOUBLE PRECISION DEFAULT NULL, + data_int INTEGER DEFAULT NULL, + data_text CLOB DEFAULT NULL, + data_type_string VARCHAR(50) DEFAULT '', + language_code VARCHAR(20) DEFAULT '' NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + sort_key_int INTEGER DEFAULT 0 NOT NULL, + sort_key_string VARCHAR(255) DEFAULT '' NOT NULL, + PRIMARY KEY(id, version) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_attribute_co_id_ver_lang_code ON ezcontentobject_attribute (contentobject_id, version, language_code); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_classattr_id ON ezcontentobject_attribute (contentclassattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX sort_key_string ON ezcontentobject_attribute (sort_key_string); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_attribute_language_code ON ezcontentobject_attribute (language_code); +-- ibexa:sql-statement-separator +CREATE INDEX sort_key_int ON ezcontentobject_attribute (sort_key_int); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_attribute_co_id_ver ON ezcontentobject_attribute (contentobject_id, version); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_link ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentclassattribute_id INTEGER DEFAULT 0 NOT NULL, + from_contentobject_id INTEGER DEFAULT 0 NOT NULL, + from_contentobject_version INTEGER DEFAULT 0 NOT NULL, + relation_type INTEGER DEFAULT 1 NOT NULL, + to_contentobject_id INTEGER DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezco_link_to_co_id ON ezcontentobject_link (to_contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezco_link_from ON ezcontentobject_link (from_contentobject_id, from_contentobject_version, contentclassattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezco_link_cca_id ON ezcontentobject_link (contentclassattribute_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_name ( + contentobject_id INTEGER DEFAULT 0 NOT NULL, + content_version INTEGER DEFAULT 0 NOT NULL, + content_translation VARCHAR(20) DEFAULT '' NOT NULL, + language_id BIGINT DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT NULL, + real_translation VARCHAR(20) DEFAULT NULL, + PRIMARY KEY(contentobject_id, content_version, content_translation) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_name_lang_id ON ezcontentobject_name (language_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_name_cov_id ON ezcontentobject_name (content_version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontentobject_name_name ON ezcontentobject_name (name); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_trash ( + node_id INTEGER DEFAULT 0 NOT NULL, + contentobject_id INTEGER DEFAULT NULL, + contentobject_version INTEGER DEFAULT NULL, + depth INTEGER DEFAULT 0 NOT NULL, + is_hidden INTEGER DEFAULT 0 NOT NULL, + is_invisible INTEGER DEFAULT 0 NOT NULL, + main_node_id INTEGER DEFAULT NULL, + modified_subnode INTEGER DEFAULT 0, + parent_node_id INTEGER DEFAULT 0 NOT NULL, + path_identification_string CLOB DEFAULT NULL, + path_string VARCHAR(255) DEFAULT '' NOT NULL, + priority INTEGER DEFAULT 0 NOT NULL, + remote_id VARCHAR(100) DEFAULT '' NOT NULL, + sort_field INTEGER DEFAULT 1, + sort_order INTEGER DEFAULT 1, + trashed INTEGER DEFAULT 0 NOT NULL, + PRIMARY KEY(node_id) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_depth ON ezcontentobject_trash (depth); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_p_node_id ON ezcontentobject_trash (parent_node_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_path_ident ON ezcontentobject_trash (path_identification_string); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_co_id ON ezcontentobject_trash (contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_modified_subnode ON ezcontentobject_trash (modified_subnode); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_trash_path ON ezcontentobject_trash (path_string); +-- ibexa:sql-statement-separator +CREATE TABLE ezcontentobject_version ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentobject_id INTEGER DEFAULT NULL, + created INTEGER DEFAULT 0 NOT NULL, + creator_id INTEGER DEFAULT 0 NOT NULL, + initial_language_id BIGINT DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL, + modified INTEGER DEFAULT 0 NOT NULL, + status INTEGER DEFAULT 0 NOT NULL, + user_id INTEGER DEFAULT 0 NOT NULL, + version INTEGER DEFAULT 0 NOT NULL, + workflow_event_pos INTEGER DEFAULT 0 +); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_version_status ON ezcontentobject_version (status); +-- ibexa:sql-statement-separator +CREATE INDEX idx_object_version_objver ON ezcontentobject_version (contentobject_id, version); +-- ibexa:sql-statement-separator +CREATE INDEX ezcontobj_version_obj_status ON ezcontentobject_version (contentobject_id, status); +-- ibexa:sql-statement-separator +CREATE INDEX ezcobj_version_creator_id ON ezcontentobject_version (creator_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezdfsfile ( + name_hash VARCHAR(34) DEFAULT '' NOT NULL, + name CLOB NOT NULL, + name_trunk CLOB NOT NULL, + datatype VARCHAR(255) DEFAULT 'application/octet-stream' NOT NULL, + scope VARCHAR(25) DEFAULT '' NOT NULL, + size BIGINT UNSIGNED DEFAULT 0 NOT NULL, + mtime INTEGER DEFAULT 0 NOT NULL, + expired BOOLEAN DEFAULT '0' NOT NULL, + status BOOLEAN DEFAULT '0' NOT NULL, + PRIMARY KEY(name_hash) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_name_trunk ON ezdfsfile (name_trunk); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_expired_name ON ezdfsfile (expired, name); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_name ON ezdfsfile (name); +-- ibexa:sql-statement-separator +CREATE INDEX ezdfsfile_mtime ON ezdfsfile (mtime); +-- ibexa:sql-statement-separator +CREATE TABLE ezgmaplocation ( + contentobject_attribute_id INTEGER DEFAULT 0 NOT NULL, + contentobject_version INTEGER DEFAULT 0 NOT NULL, + latitude DOUBLE PRECISION DEFAULT '0' NOT NULL, + longitude DOUBLE PRECISION DEFAULT '0' NOT NULL, + address VARCHAR(150) DEFAULT NULL, + PRIMARY KEY(contentobject_attribute_id, contentobject_version) +); +-- ibexa:sql-statement-separator +CREATE INDEX latitude_longitude_key ON ezgmaplocation (latitude, longitude); +-- ibexa:sql-statement-separator +CREATE TABLE ezimagefile ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentobject_attribute_id INTEGER DEFAULT 0 NOT NULL, + filepath CLOB NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezimagefile_file ON ezimagefile (filepath); +-- ibexa:sql-statement-separator +CREATE INDEX ezimagefile_coid ON ezimagefile (contentobject_attribute_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezkeyword ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + class_id INTEGER DEFAULT 0 NOT NULL, + keyword VARCHAR(255) DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_keyword ON ezkeyword (keyword); +-- ibexa:sql-statement-separator +CREATE TABLE ezkeyword_attribute_link ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + keyword_id INTEGER DEFAULT 0 NOT NULL, + objectattribute_id INTEGER DEFAULT 0 NOT NULL, + version INTEGER DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_attr_link_oaid ON ezkeyword_attribute_link (objectattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_attr_link_kid_oaid ON ezkeyword_attribute_link (keyword_id, objectattribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezkeyword_attr_link_oaid_ver ON ezkeyword_attribute_link (objectattribute_id, version); +-- ibexa:sql-statement-separator +CREATE TABLE ezmedia ( + contentobject_attribute_id INTEGER DEFAULT 0 NOT NULL, + version INTEGER DEFAULT 0 NOT NULL, + controls VARCHAR(50) DEFAULT NULL, + filename VARCHAR(255) DEFAULT '' NOT NULL, + has_controller INTEGER DEFAULT 0, + height INTEGER DEFAULT NULL, + is_autoplay INTEGER DEFAULT 0, + is_loop INTEGER DEFAULT 0, + mime_type VARCHAR(50) DEFAULT '' NOT NULL, + original_filename VARCHAR(255) DEFAULT '' NOT NULL, + pluginspage VARCHAR(255) DEFAULT NULL, + quality VARCHAR(50) DEFAULT NULL, + width INTEGER DEFAULT NULL, + PRIMARY KEY(contentobject_attribute_id, version) +); +-- ibexa:sql-statement-separator +CREATE TABLE eznode_assignment ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentobject_id INTEGER DEFAULT NULL, + contentobject_version INTEGER DEFAULT NULL, + from_node_id INTEGER DEFAULT 0, + is_main INTEGER DEFAULT 0 NOT NULL, + op_code INTEGER DEFAULT 0 NOT NULL, + parent_node INTEGER DEFAULT NULL, + parent_remote_id VARCHAR(100) DEFAULT '' NOT NULL, + remote_id VARCHAR(100) DEFAULT '0' NOT NULL, + sort_field INTEGER DEFAULT 1, + sort_order INTEGER DEFAULT 1, + priority INTEGER DEFAULT 0 NOT NULL, + is_hidden INTEGER DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_is_main ON eznode_assignment (is_main); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_coid_cov ON eznode_assignment (contentobject_id, contentobject_version); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_parent_node ON eznode_assignment (parent_node); +-- ibexa:sql-statement-separator +CREATE INDEX eznode_assignment_co_version ON eznode_assignment (contentobject_version); +-- ibexa:sql-statement-separator +CREATE TABLE eznotification ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + owner_id INTEGER DEFAULT 0 NOT NULL, + is_pending BOOLEAN DEFAULT '1' NOT NULL, + type VARCHAR(128) DEFAULT '' NOT NULL, + created INTEGER DEFAULT 0 NOT NULL, + data CLOB DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX eznotification_owner_is_pending ON eznotification (owner_id, is_pending); +-- ibexa:sql-statement-separator +CREATE INDEX eznotification_owner ON eznotification (owner_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezpackage ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + install_date INTEGER DEFAULT 0 NOT NULL, + name VARCHAR(100) DEFAULT '' NOT NULL, + version VARCHAR(30) DEFAULT '0' NOT NULL +); +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + function_name VARCHAR(255) DEFAULT NULL, + module_name VARCHAR(255) DEFAULT NULL, + original_id INTEGER DEFAULT 0 NOT NULL, + role_id INTEGER DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_role_id ON ezpolicy (role_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_original_id ON ezpolicy (original_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy_limitation ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + identifier VARCHAR(255) DEFAULT '' NOT NULL, + policy_id INTEGER DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX policy_id ON ezpolicy_limitation (policy_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezpolicy_limitation_value ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + limitation_id INTEGER DEFAULT NULL, + value VARCHAR(255) DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_limit_value_limit_id ON ezpolicy_limitation_value (limitation_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezpolicy_limitation_value_val ON ezpolicy_limitation_value (value); +-- ibexa:sql-statement-separator +CREATE TABLE ezpreferences ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + name VARCHAR(100) DEFAULT NULL, + user_id INTEGER DEFAULT 0 NOT NULL, + value CLOB DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezpreferences_user_id_idx ON ezpreferences (user_id, name); +-- ibexa:sql-statement-separator +CREATE INDEX ezpreferences_name ON ezpreferences (name); +-- ibexa:sql-statement-separator +CREATE TABLE ezrole ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + is_new INTEGER DEFAULT 0 NOT NULL, + name VARCHAR(255) DEFAULT '' NOT NULL, + value CHAR(1) DEFAULT NULL, + version INTEGER DEFAULT 0 +); +-- ibexa:sql-statement-separator +CREATE TABLE ezsearch_object_word_link ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentclass_attribute_id INTEGER DEFAULT 0 NOT NULL, + contentclass_id INTEGER DEFAULT 0 NOT NULL, + contentobject_id INTEGER DEFAULT 0 NOT NULL, + frequency DOUBLE PRECISION DEFAULT '0' NOT NULL, + identifier VARCHAR(255) DEFAULT '' NOT NULL, + integer_value INTEGER DEFAULT 0 NOT NULL, + next_word_id INTEGER DEFAULT 0 NOT NULL, + placement INTEGER DEFAULT 0 NOT NULL, + prev_word_id INTEGER DEFAULT 0 NOT NULL, + published INTEGER DEFAULT 0 NOT NULL, + section_id INTEGER DEFAULT 0 NOT NULL, + word_id INTEGER DEFAULT 0 NOT NULL, + language_mask BIGINT DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_object ON ezsearch_object_word_link (contentobject_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_identifier ON ezsearch_object_word_link (identifier); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_integer_value ON ezsearch_object_word_link (integer_value); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_word ON ezsearch_object_word_link (word_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_object_word_link_frequency ON ezsearch_object_word_link (frequency); +-- ibexa:sql-statement-separator +CREATE TABLE ezsearch_word ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + object_count INTEGER DEFAULT 0 NOT NULL, + word VARCHAR(150) DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_word_word_i ON ezsearch_word (word); +-- ibexa:sql-statement-separator +CREATE INDEX ezsearch_word_obj_count ON ezsearch_word (object_count); +-- ibexa:sql-statement-separator +CREATE TABLE ezsection ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + identifier VARCHAR(255) DEFAULT NULL, + locale VARCHAR(255) DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + navigation_part_identifier VARCHAR(100) DEFAULT 'ezcontentnavigationpart' +); +-- ibexa:sql-statement-separator +CREATE TABLE ezsite_data ( + name VARCHAR(60) DEFAULT '' NOT NULL, + value CLOB NOT NULL, + PRIMARY KEY(name) +); +-- ibexa:sql-statement-separator +CREATE TABLE ezurl ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + created INTEGER DEFAULT 0 NOT NULL, + is_valid INTEGER DEFAULT 1 NOT NULL, + last_checked INTEGER DEFAULT 0 NOT NULL, + modified INTEGER DEFAULT 0 NOT NULL, + original_url_md5 VARCHAR(32) DEFAULT '' NOT NULL, + url CLOB DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_url ON ezurl (url); +-- ibexa:sql-statement-separator +CREATE TABLE ezurl_object_link ( + contentobject_attribute_id INTEGER DEFAULT 0 NOT NULL, + contentobject_attribute_version INTEGER DEFAULT 0 NOT NULL, + url_id INTEGER DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_coa_id ON ezurl_object_link (contentobject_attribute_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_url_id ON ezurl_object_link (url_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_coa_version ON ezurl_object_link (contentobject_attribute_version); +-- ibexa:sql-statement-separator +CREATE INDEX ezurl_ol_coa_id_cav ON ezurl_object_link (contentobject_attribute_id, contentobject_attribute_version); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + destination_url CLOB NOT NULL, + forward_to_id INTEGER DEFAULT 0 NOT NULL, + is_imported INTEGER DEFAULT 0 NOT NULL, + is_internal INTEGER DEFAULT 1 NOT NULL, + is_wildcard INTEGER DEFAULT 0 NOT NULL, + source_md5 VARCHAR(32) DEFAULT NULL, + source_url CLOB NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_source_md5 ON ezurlalias (source_md5); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_wcard_fwd ON ezurlalias (is_wildcard, forward_to_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_forward_to_id ON ezurlalias (forward_to_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_imp_wcard_fwd ON ezurlalias (is_imported, is_wildcard, forward_to_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_source_url ON ezurlalias (source_url); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_desturl ON ezurlalias (destination_url); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias_ml ( + parent INTEGER DEFAULT 0 NOT NULL, + text_md5 VARCHAR(32) DEFAULT '' NOT NULL, + "action" CLOB NOT NULL, + action_type VARCHAR(32) DEFAULT '' NOT NULL, + alias_redirects INTEGER DEFAULT 1 NOT NULL, + id INTEGER DEFAULT 0 NOT NULL, + is_alias INTEGER DEFAULT 0 NOT NULL, + is_original INTEGER DEFAULT 0 NOT NULL, + lang_mask BIGINT DEFAULT 0 NOT NULL, + link INTEGER DEFAULT 0 NOT NULL, + text CLOB NOT NULL, + PRIMARY KEY(parent, text_md5) +); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_actt_org_al ON ezurlalias_ml (action_type, is_original, is_alias); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_text_lang ON ezurlalias_ml (text, lang_mask, parent); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_par_act_id_lnk ON ezurlalias_ml ("action", id, link, parent); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_par_lnk_txt ON ezurlalias_ml (parent, text, link); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_act_org ON ezurlalias_ml ("action", is_original); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_text ON ezurlalias_ml (text, id, link); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_link ON ezurlalias_ml (link); +-- ibexa:sql-statement-separator +CREATE INDEX ezurlalias_ml_id ON ezurlalias_ml (id); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlalias_ml_incr ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL +); +-- ibexa:sql-statement-separator +CREATE TABLE ezurlwildcard ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + destination_url CLOB NOT NULL, + source_url CLOB NOT NULL, + type INTEGER DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_accountkey ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + hash_key VARCHAR(32) DEFAULT '' NOT NULL, + time INTEGER DEFAULT 0 NOT NULL, + user_id INTEGER DEFAULT 0 NOT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX hash_key ON ezuser_accountkey (hash_key); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_role ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + contentobject_id INTEGER DEFAULT NULL, + limit_identifier VARCHAR(255) DEFAULT '', + limit_value VARCHAR(255) DEFAULT '', + role_id INTEGER DEFAULT NULL +); +-- ibexa:sql-statement-separator +CREATE INDEX ezuser_role_role_id ON ezuser_role (role_id); +-- ibexa:sql-statement-separator +CREATE INDEX ezuser_role_contentobject_id ON ezuser_role (contentobject_id); +-- ibexa:sql-statement-separator +CREATE TABLE ezuser_setting ( + user_id INTEGER DEFAULT 0 NOT NULL, + is_enabled INTEGER DEFAULT 0 NOT NULL, + max_login INTEGER DEFAULT NULL, + PRIMARY KEY(user_id) +); +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_setting ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + "group" VARCHAR(128) NOT NULL, + identifier VARCHAR(128) NOT NULL, + value CLOB NOT NULL --(DC2Type:json) +); +-- ibexa:sql-statement-separator +CREATE INDEX ibexa_setting_id ON ibexa_setting (id); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ibexa_setting_group_identifier ON ibexa_setting ("group", identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_token_type ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + identifier VARCHAR(64) NOT NULL +); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ibexa_token_type_unique ON ibexa_token_type (identifier); +-- ibexa:sql-statement-separator +CREATE TABLE ibexa_token ( + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + type_id INTEGER NOT NULL, + token VARCHAR(255) NOT NULL, + identifier VARCHAR(128) DEFAULT NULL, + created INTEGER DEFAULT 0 NOT NULL, + expires INTEGER DEFAULT 0 NOT NULL, + revoked BOOLEAN DEFAULT '0' NOT NULL, + CONSTRAINT ibexa_token_type_id_fk FOREIGN KEY (type_id) REFERENCES ibexa_token_type (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE +); +-- ibexa:sql-statement-separator +CREATE INDEX IDX_B5412887C54C8C93 ON ibexa_token (type_id); +-- ibexa:sql-statement-separator +CREATE UNIQUE INDEX ibexa_token_unique ON ibexa_token (token, identifier, type_id); diff --git a/src/bundle/RepositoryInstaller/Resources/config/services.yml b/src/bundle/RepositoryInstaller/Resources/config/services.yml index 965404750b..e7e1d58400 100644 --- a/src/bundle/RepositoryInstaller/Resources/config/services.yml +++ b/src/bundle/RepositoryInstaller/Resources/config/services.yml @@ -5,6 +5,19 @@ services: arguments: - '@=service("kernel").locateResource("@IbexaCoreBundle/Resources/config/storage/legacy/schema.yaml")' + Ibexa\Bundle\RepositoryInstaller\Migration\TaggedMigrationsRunner: + public: false + arguments: + # Mandatory: this whole service definition is removed by RemoveTaggedMigrationsRunnerPass + # when unavailable, so compilation never attempts to resolve this reference in that case. + # Not defined here, since it belongs to that package, not this one. + # Ibexa\Contracts\DoctrineMigrations\Migrations\IbexaOnlyDependencyFactory::SERVICE_ID + $dependencyFactory: '@ibexa.doctrine_migrations.dependency_factory.ibexa_migrations_only' + + Ibexa\Bundle\RepositoryInstaller\Migration\SchemaBuilderEventSchemaProvider: + autowire: true + public: false + Ibexa\Bundle\RepositoryInstaller\Installer\DbBasedInstaller: abstract: true arguments: ['@ibexa.persistence.connection'] @@ -13,13 +26,19 @@ services: Ibexa\Bundle\RepositoryInstaller\Installer\CoreInstaller: autowire: true parent: Ibexa\Bundle\RepositoryInstaller\Installer\DbBasedInstaller + arguments: + $schemaBuilderEventEnabled: '%ibexa.installer.schema_builder_event.enabled%' + # Optional: TaggedMigrationsRunner's own service definition may not exist at all + # (RemoveTaggedMigrationsRunnerPass removes it when "ibexa/doctrine-migrations" isn't + # installed/enabled) - autowiring alone can't express "pass null if absent". + $taggedMigrationsRunner: '@?Ibexa\Bundle\RepositoryInstaller\Migration\TaggedMigrationsRunner' tags: - { name: ibexa.installer, type: ibexa-oss } Ibexa\Bundle\RepositoryInstaller\Command\InstallPlatformCommand: arguments: $connection: '@ibexa.persistence.connection' - $installers: [] + $installers: !tagged_locator { tag: 'ibexa.installer', index_by: 'type' } $cachePool: '@ibexa.cache_pool' $environment: "%kernel.environment%" $repositoryConfigurationProvider: '@Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider' diff --git a/tests/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPassTest.php b/tests/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPassTest.php deleted file mode 100644 index 0582363709..0000000000 --- a/tests/bundle/RepositoryInstaller/DependencyInjection/Compiler/InstallerTagPassTest.php +++ /dev/null @@ -1,58 +0,0 @@ -setDefinition( - InstallPlatformCommand::class, - new Definition(InstallPlatformCommand::class, ['$installers' => []]) - ); - $definition = new Definition(); - $definition->addTag( - InstallerTagPass::INSTALLER_TAG, - [ - 'type' => 'installer_type', - ] - ); - - $this->setDefinition('service_id', $definition); - $this->compile(); - - $this->assertContainerBuilderHasServiceDefinitionWithArgument( - InstallPlatformCommand::class, - '$installers', - [ - 'installer_type' => new Reference('service_id'), - ] - ); - } - - protected function registerCompilerPass(ContainerBuilder $container): void - { - $container->addCompilerPass(new InstallerTagPass()); - } -} - -class_alias(InstallerTagPassTest::class, 'EzSystems\PlatformInstallerBundleTests\DependencyInjection\Compiler\InstallerTagPassTest'); diff --git a/tests/bundle/RepositoryInstaller/DependencyInjection/Compiler/RegisterSchemaBuilderEventSchemaProviderPassTest.php b/tests/bundle/RepositoryInstaller/DependencyInjection/Compiler/RegisterSchemaBuilderEventSchemaProviderPassTest.php new file mode 100644 index 0000000000..b0270133e3 --- /dev/null +++ b/tests/bundle/RepositoryInstaller/DependencyInjection/Compiler/RegisterSchemaBuilderEventSchemaProviderPassTest.php @@ -0,0 +1,63 @@ +setDefinition(IbexaOnlyDependencyFactory::SERVICE_ID, new Definition()); + $container->setDefinition(SchemaBuilderEventSchemaProvider::class, new Definition()); + + (new RegisterSchemaBuilderEventSchemaProviderPass())->process($container); + + $calls = $container->getDefinition(IbexaOnlyDependencyFactory::SERVICE_ID)->getMethodCalls(); + self::assertCount(1, $calls); + self::assertSame('setService', $calls[0][0]); + self::assertSame(SchemaProvider::class, $calls[0][1][0]); + self::assertInstanceOf(Reference::class, $calls[0][1][1]); + self::assertSame(SchemaBuilderEventSchemaProvider::class, (string) $calls[0][1][1]); + } + + public function testIsNoOpWhenIbexaOnlyDependencyFactoryIsNotDefined(): void + { + $container = new ContainerBuilder(); + $container->setDefinition(SchemaBuilderEventSchemaProvider::class, new Definition()); + + (new RegisterSchemaBuilderEventSchemaProviderPass())->process($container); + + $this->addToAssertionCount(1); + } + + public function testIsNoOpWhenSchemaBuilderEventSchemaProviderIsNotDefined(): void + { + $container = new ContainerBuilder(); + $container->setDefinition(IbexaOnlyDependencyFactory::SERVICE_ID, new Definition()); + + (new RegisterSchemaBuilderEventSchemaProviderPass())->process($container); + + self::assertSame( + [], + $container->getDefinition(IbexaOnlyDependencyFactory::SERVICE_ID)->getMethodCalls() + ); + } +} diff --git a/tests/bundle/RepositoryInstaller/DependencyInjection/IbexaInstallerExtensionTest.php b/tests/bundle/RepositoryInstaller/DependencyInjection/IbexaInstallerExtensionTest.php index 19ff4e77d1..ef93b0dbf8 100644 --- a/tests/bundle/RepositoryInstaller/DependencyInjection/IbexaInstallerExtensionTest.php +++ b/tests/bundle/RepositoryInstaller/DependencyInjection/IbexaInstallerExtensionTest.php @@ -9,7 +9,6 @@ namespace Ibexa\Tests\Bundle\RepositoryInstaller\DependencyInjection; use Ibexa\Bundle\RepositoryInstaller\Command\InstallPlatformCommand; -use Ibexa\Bundle\RepositoryInstaller\DependencyInjection\Compiler\InstallerTagPass; use Ibexa\Bundle\RepositoryInstaller\DependencyInjection\IbexaRepositoryInstallerExtension; use Ibexa\Bundle\RepositoryInstaller\Installer\CoreInstaller; use Ibexa\Bundle\RepositoryInstaller\Installer\DbBasedInstaller; @@ -32,7 +31,7 @@ public function testLoadLoadsTaggedCoreInstaller(): void ); $this->assertContainerBuilderHasServiceDefinitionWithTag( CoreInstaller::class, - InstallerTagPass::INSTALLER_TAG, + 'ibexa.installer', ['type' => 'clean'] ); } diff --git a/tests/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundleTest.php b/tests/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundleTest.php index 323370c693..fec8749159 100644 --- a/tests/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundleTest.php +++ b/tests/bundle/RepositoryInstaller/IbexaRepositoryInstallerBundleTest.php @@ -9,10 +9,8 @@ namespace Ibexa\Tests\Bundle\RepositoryInstaller; use Ibexa\Bundle\DoctrineSchema\DependencyInjection\DoctrineSchemaExtension; -use Ibexa\Bundle\RepositoryInstaller\DependencyInjection\Compiler\InstallerTagPass; use Ibexa\Bundle\RepositoryInstaller\IbexaRepositoryInstallerBundle; use PHPUnit\Framework\TestCase; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\RuntimeException; @@ -33,17 +31,10 @@ public function testBuild(): void { $container = new ContainerBuilder(); $container->registerExtension(new DoctrineSchemaExtension()); + $this->bundle->build($container); - // check if InstallerTagPass was added - self::assertNotEmpty( - array_filter( - $container->getCompilerPassConfig()->getPasses(), - static function (CompilerPassInterface $compilerPass) { - return $compilerPass instanceof InstallerTagPass; - } - ) - ); + $this->expectNotToPerformAssertions(); } /** diff --git a/tests/bundle/RepositoryInstaller/Migration/SchemaBuilderEventSchemaProviderTest.php b/tests/bundle/RepositoryInstaller/Migration/SchemaBuilderEventSchemaProviderTest.php new file mode 100644 index 0000000000..b63fcbcd62 --- /dev/null +++ b/tests/bundle/RepositoryInstaller/Migration/SchemaBuilderEventSchemaProviderTest.php @@ -0,0 +1,34 @@ +createMock(SchemaBuilderInterface::class); + $schemaBuilder->expects(self::once()) + ->method('buildSchema') + ->willReturn($schema); + + $provider = new SchemaBuilderEventSchemaProvider($schemaBuilder); + + self::assertSame($schema, $provider->createSchema()); + } +}