Join things together to postgres

This commit is contained in:
Bofh 2021-11-26 01:02:27 +01:00
parent 5282b5cabb
commit ff33fd7bcf
5 changed files with 31 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.*.swp
*.mock
config/config.php
migrations/*.done

View File

@ -1,5 +1,10 @@
<?php
$config = [
"db_host" => "127.0.0.1",
"db_port" => 5432,
"db_name" => "realfan",
"db_user" => "realfan",
"db_pass" => "changemeNOW",
"site_name" => "https://your-site.com",
];

View File

@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS users (
id serial PRIMARY KEY,
acct VARCHAR(64) UNIQUE NOT NULL,
access_token VARCHAR(128) NOT NULL,
account_data TEXT NULL,
account_type VARCHAR(32) NOT NULL,
created_on TIMESTAMP NOT NULL
);

View File

@ -1,3 +1,4 @@
<?php require_once '/src/classes/database.php' ?>
<?php
# TODO: uncomment when done

15
src/classes/database.php Normal file
View File

@ -0,0 +1,15 @@
<?php
class Database {
private $db;
public function __construct() {
$this->db = new PDO('pgsql:host=db;dbname=realfan', 'realfan', 'changemeNOW');
}
public function close() {
$this->db->close();
}
}