LabiciIvan / php-api-nutritional-project

A PHP API nutritional project
0 stars 0 forks source link

User login table #30

Closed LabiciIvan closed 1 month ago

LabiciIvan commented 1 month ago

Description:

Create a migration which will create a login table in MySQL.

This table will have the following columns:

id.................... INT PRIMARY KEY AUTO_INCREMENT, ctime............. TIMESTAMP DEFAULT CURRENT_TIMESTAMP, utime............. TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, token............. TEXT NOT NULL, expire_at...... TIMESTAMP NOT NULL, deleted......... ENUM('Y', 'N') DEFAULT ('N'), user_id.......... INT NOT NULL FOREGIN KEY REFERENCES users(id)

This migration table will be used to log in users and log out by setting a token to a specific user_id as well as enabling it by marking deleted to N otherwise when deleted will be marked to Y and it means user si logged out.