Skip to content

Instantly share code, notes, and snippets.

@martinbean

martinbean/error.md Secret

Last active Aug 29, 2015
Embed
What would you like to do?

A Database Error Occurred Error Number: 1146

Table 'tradepark.exp_channel_grid_field_' doesn't exist

ALTER TABLE `exp_channel_grid_field_` ADD `col_id_10` text NULL

Filename: libraries/api/Api_channel_fields.php

Line Number: 675

<?php
private function create_floor_plans_field($prefix, $group_id)
{
$this->EE->load->model('grid_model');
// Create grid field
$settings = array(
'field_name' => $prefix.'_floor_plans',
'field_label' => 'Floor Plans',
'field_type' => 'grid',
'field_order' => 30,
'field_instructions' => 'The floor plans for the property',
'field_required' => 'n',
'field_search' => 'n',
'field_is_hidden' => 'n',
);
$field_id = $this->EE->grid_model->create_field($settings, 'grid');
// Create column in grid
$settings = array(
'field_id' => $field_id,
'col_order' => 0,
'col_type' => 'file',
'col_label' => 'File',
'col_name' => 'floor_plan_file',
'col_instructions' => 'A floor plan.',
'col_required' => 'y',
'col_search' => 'n',
'col_settings' => json_encode(array(
'field_content_type' => 'all',
'allowed_directories' => 'all',
'show_existing' => 'y',
'num_existing' => 50,
'field_required' => 'y',
)),
);
$this->EE->grid_model->save_col_settings($settings, FALSE, 'channel');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.