develop #26

Merged
vex merged 48 commits from develop into main 2025-04-21 15:14:19 +00:00
5 changed files with 40 additions and 27 deletions
Showing only changes of commit 24b01903ef - Show all commits

View File

@ -1,10 +1,10 @@
CREATE TABLE `discount`
(
`deleted_at` INT(8) NOT NULL,
`name` VARCHAR(255) NOT NULL,
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR(255) NOT NULL,
`description` TEXT NOT NULL,
`discount_percent` DECIMAL(8, 2) NOT NULL,
`deleted_at` INT(8) NOT NULL,
`modified_at` INT(8) NOT NULL,
`created_at` INT(8) NOT NULL,
`active` BOOLEAN NOT NULL
@ -101,16 +101,16 @@ CREATE TABLE `product_category`
);
CREATE TABLE `user`
(
`is_active` BOOLEAN NOT NULL,
`is_active` BOOLEAN NOT NULL DEFAULT '1',
`lower_name` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`passwd_hash_algo` VARCHAR(255) NOT NULL,
`modified_at` INT(8) NOT NULL,
`is_admin` BOOLEAN NOT NULL,
`email` VARCHAR(255) NOT NULL DEFAULT 'NONE',
`passwd_hash_algo` VARCHAR(255) NOT NULL DEFAULT 'NONE',
`modified_at` INT(8) NOT NULL DEFAULT '0',
`is_admin` BOOLEAN NOT NULL DEFAULT '0',
`name` VARCHAR(255) NOT NULL,
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`created_at` INT(8) NOT NULL,
`passwd` VARCHAR(255) NOT NULL
`created_at` INT(8) NOT NULL DEFAULT '0',
`passwd` VARCHAR(255) NOT NULL DEFAULT 'NONE'
);
ALTER TABLE
`user`

View File

@ -0,0 +1,13 @@
CREATE PROCEDURE prepare_data()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i < 100
DO
INSERT INTO webshop.user(is_active, name, lower_name, email)
VALUES ('1', 'harry', 'potter', 'test@test.de');
SET i = i + 1;
end while;
end;
CALL prepare_data();

View File

@ -1,17 +0,0 @@
const mysql = require('mysql');
const connection = mysql.createConnection({
host: "localhost",
user: "root",
password: "",
database: "webshop"
});
connection.connect(function (err) {
if (err) throw err;
console.log("Connected to database");
connection.query("SELECT * FROM user", function (err, result) {
if (err) throw err;
console.log(result);
})
});

View File

@ -5,4 +5,4 @@ APP_PORT=3000
DB_HOST=172.0.0.1:3306
DB_USER=root
DB_PASSWORD=
DB_DATABASE=
DB_DATABASE=webshop

View File

@ -0,0 +1,17 @@
const mysql = require('mysql');
const connection = mysql.createConnection({
host: "localhost",
user: "root",
password: "",
database: "webshop"
})
connection.connect(function (err) {
if (err) throw err
console.log("Connected to database")
connection.query("SELECT * FROM user WHERE ID = 1", function (err, result) {
if (err) throw err
console.log(result)
})
})