You are here

function content_synchronizer_get_schema in Content Synchronizer 8.2

Same name and namespace in other branches
  1. 8 content_synchronizer.install \content_synchronizer_get_schema()
  2. 3.x content_synchronizer.install \content_synchronizer_get_schema()

Define schema.

2 calls to content_synchronizer_get_schema()
content_synchronizer_create_tables in ./content_synchronizer.install
Create useful tables from schema.
content_synchronizer_uninstall in ./content_synchronizer.install
Delete tables.

File

./content_synchronizer.install, line 11
Installation hooks for content_synchronizer module.

Code

function content_synchronizer_get_schema() {
  $schema['content_synchronizer_global_reference'] = [
    'description' => 'Table for global reference',
    'fields' => [
      'gid' => [
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 100,
        'default' => '',
        'not null' => TRUE,
      ],
      'entity_id' => [
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 100,
        'default' => '',
        'not null' => TRUE,
      ],
      'entity_type' => [
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 100,
        'default' => '',
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'gid',
    ],
  ];
  $schema['content_synchronizer_export_items'] = [
    'description' => 'Table for export items',
    'fields' => [
      'export_id' => [
        'type' => 'int',
        'default' => 0,
        'size' => 'normal',
        'not null' => TRUE,
      ],
      'entity_id' => [
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 100,
        'default' => '',
        'not null' => TRUE,
      ],
      'entity_type' => [
        'type' => 'varchar',
        'size' => 'normal',
        'length' => 100,
        'default' => '',
        'not null' => TRUE,
      ],
    ],
    'primary key' => [
      'export_id',
      'entity_id',
      'entity_type',
    ],
  ];
  return $schema;
}