Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 20, 2021 22:23
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/2278a106445dbc2146f65bcf5d874b2c to your computer and use it in GitHub Desktop.
Save parzibyte/2278a106445dbc2146f65bcf5d874b2c to your computer and use it in GitHub Desktop.
CREATE TABLE usuarios(
id BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
correo VARCHAR(255) NOT NULL,
palabra_secreta VARCHAR(255) NOT NULL
);
/*
Solo necesitamos el id del usuario, vamos a insertar
un valor cada vez que haya un login no exitoso, y
luego vamos a contar cuántos valores hay
*/
CREATE TABLE intentos_usuarios(
id_usuario BIGINT UNSIGNED NOT NULL,
FOREIGN KEY (id_usuario) REFERENCES usuarios(id) ON DELETE CASCADE ON UPDATE CASCADE
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment