diff --git a/auth-check.php b/auth-check.php
index 37c4786..0614be9 100644
--- a/auth-check.php
+++ b/auth-check.php
@@ -1,13 +1,7 @@
\ No newline at end of file
diff --git a/db/config.php b/db/config.php
index 2714b40..4314103 100644
--- a/db/config.php
+++ b/db/config.php
@@ -23,22 +23,5 @@ function db() {
}
- // Migration logic
- $pdo->exec('CREATE TABLE IF NOT EXISTS migrations (migration VARCHAR(255) PRIMARY KEY)');
- $ran_migrations = $pdo->query('SELECT migration FROM migrations')->fetchAll(PDO::FETCH_COLUMN);
-
- $migration_files = glob(__DIR__ . '/migrations/*.sql');
- sort($migration_files);
-
- foreach ($migration_files as $file) {
- $migration_name = basename($file);
- if (!in_array($migration_name, $ran_migrations)) {
- $sql = file_get_contents($file);
- $pdo->exec($sql);
- $stmt = $pdo->prepare('INSERT INTO migrations (migration) VALUES (?)');
- $stmt->execute([$migration_name]);
- }
- }
-
return $pdo;
}
diff --git a/index.php b/index.php
index 7fcb675..e456312 100644
--- a/index.php
+++ b/index.php
@@ -1,9 +1,5 @@
fetch(PDO::FETCH_ASSOC);
if ($user && password_verify($password, $user['password'])) {
- error_log("login.php: Login successful for user ID: " . $user['id']);
$_SESSION['user_id'] = $user['id'];
$_SESSION['user_name'] = $user['name'];
$_SESSION['user_role'] = $user['role'];
- error_log("login.php: \$_SESSION after login: " . print_r($_SESSION, true));
header("Location: index.php");
exit;
} else {
$error_message = 'Invalid email or password.';
- error_log("login.php: " . $error_message);
}
} catch (PDOException $e) {
$error_message = 'Database error: ' . $e->getMessage();
- error_log("login.php: " . $error_message);
}
}
}
diff --git a/run-migrations.php b/run-migrations.php
deleted file mode 100644
index 79671b0..0000000
--- a/run-migrations.php
+++ /dev/null
@@ -1,23 +0,0 @@
-exec($sql);
- echo "Successfully ran migration: " . basename($file) . "
";
- } catch (PDOException $e) {
- echo "Error running migration: " . basename($file) . " - " . $e->getMessage() . "
";
- }
-}
-
-// Self-destruct
-unlink(__FILE__);
-
-echo "
All migrations have been processed. This script has been deleted.";