| @@ 142-153 (lines=12) @@ | ||
| 139 | ||
| 140 | ||
| 141 | // Group task sharing table |
|
| 142 | if ( ! $this->hasTable('todo_group_task_link')) |
|
| 143 | { |
|
| 144 | $this->table('todo_group_task_link', [ |
|
| 145 | 'id' => FALSE, |
|
| 146 | 'primary_key' => ['group_id', 'task_id'] |
|
| 147 | ])->addColumn('group_id', 'integer') |
|
| 148 | ->addColumn('task_id', 'integer') |
|
| 149 | ->addColumn('permissions', 'integer') |
|
| 150 | ->addForeignKey('group_id', 'todo_group', 'id') |
|
| 151 | ->addForeignKey('task_id', 'todo_item', 'id') |
|
| 152 | ->create(); |
|
| 153 | } |
|
| 154 | ||
| 155 | // Group user sharing table |
|
| 156 | if ( ! $this->hasTable('todo_group_users_link')) |
|
| @@ 156-167 (lines=12) @@ | ||
| 153 | } |
|
| 154 | ||
| 155 | // Group user sharing table |
|
| 156 | if ( ! $this->hasTable('todo_group_users_link')) |
|
| 157 | { |
|
| 158 | $this->table('todo_group_users_link', [ |
|
| 159 | 'id' => FALSE, |
|
| 160 | 'primary_key' => ['group_id', 'user_id'] |
|
| 161 | ])->addColumn('group_id', 'integer') |
|
| 162 | ->addColumn('user_id', 'integer') |
|
| 163 | ->addColumn('is_admin', 'integer') |
|
| 164 | ->addForeignKey('group_id', 'todo_group', 'id') |
|
| 165 | ->addForeignKey('user_id', 'todo_user', 'id') |
|
| 166 | ->create(); |
|
| 167 | } |
|
| 168 | ||
| 169 | // Task comments table |
|
| 170 | if ( ! $this->hasTable('todo_item_comments')) |
|
| @@ 200-211 (lines=12) @@ | ||
| 197 | } |
|
| 198 | ||
| 199 | // Friend link table |
|
| 200 | if ( ! $this->hasTable('todo_user_friend_link')) |
|
| 201 | { |
|
| 202 | $this->table('todo_user_friend_link', [ |
|
| 203 | 'id' => FALSE, |
|
| 204 | 'primary_key' => ['user_id', 'user_friend_id'] |
|
| 205 | ])->addColumn('user_id', 'integer') |
|
| 206 | ->addColumn('user_friend_id', 'integer') |
|
| 207 | ->addColumn('confirmed', 'integer', ['default' => -1]) |
|
| 208 | ->addForeignKey('user_friend_id', 'todo_user', 'id') |
|
| 209 | ->addForeignKey('user_id', 'todo_user', 'id') |
|
| 210 | ->create(); |
|
| 211 | } |
|
| 212 | ||
| 213 | // Task shared by user table |
|
| 214 | if ( ! $this->hasTable('todo_user_task_link')) |
|
| @@ 214-225 (lines=12) @@ | ||
| 211 | } |
|
| 212 | ||
| 213 | // Task shared by user table |
|
| 214 | if ( ! $this->hasTable('todo_user_task_link')) |
|
| 215 | { |
|
| 216 | $this->table('todo_user_task_link', [ |
|
| 217 | 'id' => FALSE, |
|
| 218 | 'primary_key' => ['task_id', 'user_id'] |
|
| 219 | ])->addColumn('user_id', 'integer') |
|
| 220 | ->addColumn('task_id', 'integer') |
|
| 221 | ->addColumn('permissions', 'integer') |
|
| 222 | ->addForeignKey('task_id', 'todo_item', 'id') |
|
| 223 | ->addForeignKey('user_id', 'todo_user', 'id') |
|
| 224 | ->create(); |
|
| 225 | } |
|
| 226 | } |
|
| 227 | } |
|