Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Jan 13, 2021
Embed
What would you like to do?
CREATE TABLE IF NOT EXISTS productos(
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(255) NOT NULL,
descripcion VARCHAR(1024) NOT NULL,
precio DECIMAL(9,2)
);
CREATE TABLE IF NOT EXISTS carrito_usuarios(
id_sesion VARCHAR(255) NOT NULL,
id_producto BIGINT UNSIGNED NOT NULL,
FOREIGN KEY (id_producto) REFERENCES productos(id)
ON UPDATE CASCADE ON DELETE CASCADE
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment