This commit is contained in:
Flatlogic Bot 2025-10-13 04:01:51 +00:00
parent 28a6b3ca28
commit 9b7d97bcbe
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
affiliation VARCHAR(255),
expertise TEXT,
orcid VARCHAR(255),
password VARCHAR(255) NOT NULL, -- For simplicity, will store as plaintext for now
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

11
setup.php Normal file
View File

@ -0,0 +1,11 @@
<?php
require_once 'db/config.php';
try {
$pdo = db();
$sql = file_get_contents('db/migrations/001_create_users_table.sql');
$pdo->exec($sql);
echo "Database setup successful.";
} catch (PDOException $e) {
die("Database setup failed: " . $e->getMessage());
}