INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
	VALUES ('Entry','getBuyList','READ','ALLOW','ROLE','buyer'),
		('Entry','getBuyUltimate','READ','ALLOW','ROLE','buyer'),
		('Entry','search','READ','ALLOW','ROLE','buyer'),
		('Entry','create','WRITE','ALLOW','ROLE','buyer'),
		('Entry','cloneEntry','WRITE','ALLOW','ROLE','buyer'),
		('Entry','deleteEntry','WRITE','ALLOW','ROLE','buyer'),
		('Entry','recalcEntryPrices','WRITE','ALLOW','ROLE','buyer'),
		('EntryType','find','READ','ALLOW','ROLE','buyer'),
		('EntryConfig','findOne','READ','ALLOW','ROLE','buyer');

ALTER TABLE vn.ink ADD IF NOT EXISTS hexJson TEXT NOT NULL;

UPDATE vn.ink
	SET hexJson = CONCAT('{"value": ["',hex,'"]}');

UPDATE vn.ink
SET hexJson = CASE `name`
    WHEN 'Blanco/Naranja' THEN '{"value": ["FFFFFF", "FFA500"]}'
    WHEN 'Sin especificar' THEN '{"value": ["808080"]}'
    WHEN '2 Colores' THEN '{"value": ["000000", "FFFFFF"]}'
    WHEN 'Amarillo/Marrón' THEN '{"value": ["FFFF00", "8B4513"]}'
    WHEN 'Amarillo/Naranja' THEN '{"value": ["FFFF00", "FFA500"]}'
    WHEN 'Rosa/Blanco/Amarillo' THEN '{"value": ["FFC0CB", "FFFFFF", "FFFF00"]}'
    WHEN 'Rosa/Amarillo' THEN '{"value": ["FFC0CB", "FFFF00"]}'
    WHEN 'Antracita' THEN '{"value": ["2F2F2F"]}'
    WHEN 'Azul/Amarillo' THEN '{"value": ["0000FF", "FFFF00"]}'
    WHEN 'Azul Claro' THEN '{"value": ["ADD8E6"]}'
    WHEN 'Azul/Marron' THEN '{"value": ["0000FF", "8B4513"]}'
    WHEN 'Azul/Verde' THEN '{"value": ["0000FF", "008000"]}'
    WHEN 'Blanco/Amarillo' THEN '{"value": ["FFFFFF", "FFFF00"]}'
    WHEN 'Blaugrana' THEN '{"value": ["A50044", "004D98"]}'
    WHEN 'Blanco/Negro' THEN '{"value": ["FFFFFF", "000000"]}'
    WHEN 'Blanco/Verde' THEN '{"value": ["FFFFFF", "008000"]}'
    WHEN 'Blanco/Azul' THEN '{"value": ["FFFFFF", "0000FF"]}'
    WHEN 'Blanco/Rosa' THEN '{"value": ["FFFFFF", "FFC0CB"]}'
    WHEN 'Cognac/Verde' THEN '{"value": ["9A463D", "008000"]}'
    WHEN 'Champagne/Verde' THEN '{"value": ["F7E7CE", "008000"]}'
    WHEN 'Camuflaje' THEN '{"value": ["6B8E23", "556B2F", "8B4513"]}'
    WHEN 'Crema/Rosa' THEN '{"value": ["FFFDD0", "FFC0CB"]}'
    WHEN 'Fucsia/Amarillo' THEN '{"value": ["FF00FF", "FFFF00"]}'
    WHEN 'Fucsia/Blanco' THEN '{"value": ["FF00FF", "FFFFFF"]}'
    WHEN 'Fucsia/Crema' THEN '{"value": ["FF00FF", "FFFDD0"]}'
    WHEN 'Fucsia/Rosa' THEN '{"value": ["FF00FF", "FFC0CB"]}'
    WHEN 'Fucsia/Verde' THEN '{"value": ["FF00FF", "008000"]}'
    WHEN 'Granate/Blanco' THEN '{"value": ["800000", "FFFFFF"]}'
    WHEN 'Gris Lila' THEN '{"value": ["808080", "C8A2C8"]}'
    WHEN 'Lavanda/Amarillo' THEN '{"value": ["E6E6FA", "FFFF00"]}'
    WHEN 'Lavanda/Gris' THEN '{"value": ["E6E6FA", "808080"]}'
    WHEN 'Lividum' THEN '{"value": ["702963"]}'
    WHEN 'Morado/Amarillo' THEN '{"value": ["800080", "FFFF00"]}'
    WHEN 'Marrón/Blanco' THEN '{"value": ["8B4513", "FFFFFF"]}'
    WHEN 'Marron/Gris' THEN '{"value": ["8B4513", "808080"]}'
    WHEN 'Marron/Negro' THEN '{"value": ["8B4513", "000000"]}'
    WHEN 'Marrón/Verde' THEN '{"value": ["8B4513", "008000"]}'
    WHEN 'Matizado' THEN '{"value": ["D3D3D3", "808080", "FFFFFF"]}'
    WHEN 'Mixto' THEN '{"value": ["FF0000", "0000FF", "008000", "FFFF00"]}'
    WHEN 'Marrón Oscuro' THEN '{"value": ["654321"]}'
    WHEN 'Naranja/Marron' THEN '{"value": ["FFA500", "8B4513"]}'
    WHEN 'Naranja/Rosa' THEN '{"value": ["FFA500", "FFC0CB"]}'
    WHEN 'Ocre/Burgundi' THEN '{"value": ["CC7722", "800020"]}'
    WHEN 'Oro/Plata' THEN '{"value": ["FFD700", "C0C0C0"]}'
    WHEN 'Oro/Negro' THEN '{"value": ["FFD700", "000000"]}'
    WHEN 'Oro/Verde' THEN '{"value": ["FFD700", "008000"]}'
    WHEN 'Purpura/Blanco' THEN '{"value": ["800080", "FFFFFF"]}'
    WHEN 'Purpura/Rosa' THEN '{"value": ["800080", "FFC0CB"]}'
    WHEN 'Pastel' THEN '{"value": ["FFB6C1", "87CEFA", "98FB98"]}'
    WHEN 'Plata' THEN '{"value": ["C0C0C0"]}'
    WHEN 'Plata/Verde' THEN '{"value": ["C0C0C0", "008000"]}'
    WHEN 'Rojo/Amarillo' THEN '{"value": ["FF0000", "FFFF00"]}'
    WHEN 'Rojo/Blanco' THEN '{"value": ["FF0000", "FFFFFF"]}'
    WHEN 'Rojo/Naranja' THEN '{"value": ["FF0000", "FFA500"]}'
    WHEN 'Rojo/Oro' THEN '{"value": ["FF0000", "FFD700"]}'
    WHEN 'Rojo/Verde' THEN '{"value": ["FF0000", "008000"]}'
    WHEN 'Rosa/Lila' THEN '{"value": ["FFC0CB", "C8A2C8"]}'
    WHEN 'Rosa/Naranja' THEN '{"value": ["FFC0CB", "FFA500"]}'
    WHEN 'Rojo/Rosa' THEN '{"value": ["FF0000", "FFC0CB"]}'
    WHEN 'Rosa empolvado' THEN '{"value": ["E6B8AF"]}'
    WHEN 'Rosa/Verde' THEN '{"value": ["FFC0CB", "008000"]}'
    WHEN 'Topo/Blanco' THEN '{"value": ["8B8589", "FFFFFF"]}'
    WHEN 'Topo' THEN '{"value": ["8B8589"]}'
    WHEN 'Transparente' THEN '{"value": ["00000000"]}'
    WHEN 'Verde/Amarillo' THEN '{"value": ["008000", "FFFF00"]}'
    WHEN 'Verde/Negro' THEN '{"value": ["008000", "000000"]}'
    WHEN 'Variado' THEN '{"value": ["FF0000", "0000FF", "008000", "FFFF00", "FFA500"]}'
    WHEN 'Verde Claro/Morado' THEN '{"value": ["90EE90", "800080"]}'
    WHEN 'Verde/Lila' THEN '{"value": ["008000", "C8A2C8"]}'
    WHEN 'Vaquero Neon' THEN '{"value": ["1560BD", "FFFF00"]}'
    ELSE hexJson 
END;
