Amiga-Z Wiki

“Modern tools for old-school communities.”

User Tools

Site Tools


trafficelf:database

This is an old revision of the document!


Database Schema & SQL Setup

Traffic Elf uses a MySQL database named:

trafficelf

A dedicated database user is used for application access:

Username: tedbeditor

Database Creation

CREATE DATABASE trafficelf
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;

User Access

(Assumes user already exists)

GRANT ALL PRIVILEGES ON trafficelf.*
TO 'tedbeditor'@'localhost';
 
FLUSH PRIVILEGES;

Clients Table

Stores advertiser and client information.

Columns:

  • name
  • address
  • phone
  • contact_name
  • contact_title
  • notes
CREATE TABLE clients (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    address TEXT,
    phone VARCHAR(50),
    contact_name VARCHAR(255),
    contact_title VARCHAR(255),
    notes TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

Campaigns Table

Stores advertising campaigns associated with clients or agencies.

Columns:

  • name
  • owner
  • notes
  • agency
  • start_date
  • end_date
CREATE TABLE campaigns (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    owner VARCHAR(255),
    notes TEXT,
    agency VARCHAR(255),
    start_date DATE,
    end_date DATE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

Notes

  • Foreign key relationships (clients ↔ campaigns) will be added later
  • Dates use DATE type to support scheduling and reporting
  • Timestamps assist with auditing and syncing
trafficelf/database.1770215093.txt.gz · Last modified: by freedomotter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki