سؤال

I'm using Zend Framework and doctrine 1.2.x Is there a way to define index-table name while adding Doctrine Searchable Behaviour? ./doctrine build-all-reload script generates weird "model__info_index" table name instead of "info_index"

Here is my configuration: //shema.yml

Info:
  actAs:
    Searchable:
      fields: [name, body]
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(256)
    body: clob

//application.ini

doctrine.data_fixtures_path = APPLICATION_PATH  "/configs/data/fixtures"
doctrine.sql_path = APPLICATION_PATH  "/configs/data/sql"
doctrine.migrations_path = APPLICATION_PATH  "/configs/data/migrations"
doctrine.yaml_schema_path = APPLICATION_PATH  "/configs/schema.yml"
doctrine.models_path = APPLICATION_PATH  "/models/Model/"
doctrine.generate_models_options.pearStyle = true
doctrine.generate_models_options.generateTableClasses = false
doctrine.generate_models_options.generateBaseClasses = true
doctrine.generate_models_options.baseClassPrefix = "Base_"
doctrine.generate_models_options.baseClassesDirectory = null
doctrine.generate_models_options.classPrefixFiles = false
doctrine.generate_models_options.classPrefix = "Model_"
doctrine.model_autoloading = 2
هل كانت مفيدة؟

المحلول

I too wanted to set the index table name but couldn't find anything in the documentation. However, the Versionable behaviour has the option className which also sets the table name; turns out that this also works for the Searchable behaviour:

Info:
  actAs:
    Searchable:
      fields: [name, body]
      className: InfoIndex
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(256)
    body: clob
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top