Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
[root@freepbxdev4 ~]# fwconsole doctrine outbound_routes
$table = \FreePBX::Database()->migrate("outbound_routes");
$cols = array (
  'route_id' =>
  array (
    'type' => 'integer',
    'primaryKey' => true,
    'autoincrement' => true,
  ),
  'name' =>
  array (
    'type' => 'string',
    'length' => '40',
    'notnull' => false,
  ),
  'outcid' =>
  array (
    'type' => 'string',
    'length' => '40',
    'notnull' => false,
  ),
  'outcid_mode' =>
  array (
    'type' => 'string',
    'length' => '20',
    'notnull' => false,
  ),
  'password' =>
  array (
    'type' => 'string',
    'length' => '30',
    'notnull' => false,
  ),
  'emergency_route' =>
  array (
    'type' => 'string',
    'length' => '4',
    'notnull' => false,
  ),
  'intracompany_route' =>
  array (
    'type' => 'string',
    'length' => '4',
    'notnull' => false,
  ),
  'mohclass' =>
  array (
    'type' => 'string',
    'length' => '80',
    'notnull' => false,
  ),
  'time_group_id' =>
  array (
    'type' => 'integer',
    'notnull' => false,
  ),
  'dest' =>
  array (
    'type' => 'string',
    'length' => '255',
    'notnull' => false,
  ),
  'time_mode' =>
  array (
    'type' => 'string',
    'length' => '20',
    'notnull' => false,
    'default' => 'time-group',
  ),
  'calendar_id' =>
  array (
    'type' => 'integer',
    'notnull' => false,
  ),
  'calendar_group_id' =>
  array (
    'type' => 'integer',
    'notnull' => false,
  ),
);

$indexes = array (
);
$table->modify($cols, $indexes);
unset($table);


Creating/Altering/Updating a Database Through module.xml

...

Starting in Framework 14 13 we've implemented an even easier way to generate database tables. You can now generate database tables for your module through the module.xml! First read through Creating/Altering/Updating a Database Programmatically 78479805 to understand how simple database creation works. For more information about the structure of module.xml please read through: module.xml

...