Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 13, 2021 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/786f276bd9a6c94d826304e6bb3cb2d8 to your computer and use it in GitHub Desktop.
Save parzibyte/786f276bd9a6c94d826304e6bb3cb2d8 to your computer and use it in GitHub Desktop.
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