X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSample%2FSamplePlugin.php;h=a0d1140f3725b77512fc54057df3000e89b3962c;hb=f82dd4e14f8e4797f2a14cf10527bb71bc224b72;hp=ef69121a9986459b39840025917eb79d6e3d24e1;hpb=42dd460d3b9aa9a8ad147d00de9b6c8e209ab4e9;p=quix0rs-gnu-social.git diff --git a/plugins/Sample/SamplePlugin.php b/plugins/Sample/SamplePlugin.php index ef69121a99..a0d1140f37 100644 --- a/plugins/Sample/SamplePlugin.php +++ b/plugins/Sample/SamplePlugin.php @@ -172,9 +172,20 @@ class SamplePlugin extends Plugin // For storing user-submitted flags on profiles $schema->ensureTable('user_greeting_count', - array(new ColumnDef('user_id', 'integer', null, - true, 'PRI'), - new ColumnDef('greeting_count', 'integer'))); + array( + 'fields' => array( + 'user_id' => array('type' => 'int', 'not null' => true), + 'greeting_count' => array('type' => 'int'), + ), + 'primary key' => array('user_id'), + 'foreign keys' => array( + // Not all databases will support foreign keys, but even + // when not enforced it's helpful to include these definitions + // as documentation. + 'user_greeting_count_user_id_fkey' => array('user', array('user_id' => 'id')), + ), + ) + ); return true; }