Ejemplo n.º 1
0
func init() {
	tableMap = csdb.TableStructureSlice{
		table1: csdb.NewTableStructure(
			"catalog_category_anc_categs_index_idx",
			[]string{},
			[]string{
				"category_id",
				"path",
			},
		),
		table2: csdb.NewTableStructure(
			"catalog_category_anc_categs_index_tmp",
			[]string{
				"category_id",
			},
			[]string{
				"path",
			},
		),
		table3: csdb.NewTableStructure(
			"catalog_category_anc_products_index_idx",
			[]string{},
			[]string{
				"category_id",
				"product_id",
				"position",
			},
		),
	}
}
Ejemplo n.º 2
0
func (aa *AddAttrTables) newTableStructure(tableName string) (*csdb.TableStructure, error) {
	tableName = ReplaceTablePrefix(tableName)
	cols, err := GetColumns(aa.db, tableName)
	if err != nil {
		return nil, errgo.Mask(err)
	}
	return csdb.NewTableStructure(tableName, cols.GetFieldNames(true), cols.GetFieldNames(false)), nil
}