XMF Cookbook
  • Introduction
  • XMF Cookbook
  • Basic Ingredients
    • Namespaces
    • Autoloading
    • Debugging
    • Forward Compatibility
  • Recipes
    • Introducing Module Helpers
    • Using the Permission Helper
      • Checking Permissions
      • Managing Item Permissions
    • Using the Session Helper
    • Using JSON Web Tokens
    • Altering Database Tables
    • Migrating a Module's Database
    • Loading Initial Data
    • Module Admin Pages
      • Hide and Seek with Icons
      • Standard Admin Pages
    • Manage Metadata
    • Highlighting Content
  • Reference
    • Assert
      • Assertions
    • Database
      • Migrate
      • TableLoad
      • Tables
        • Getting Started
        • Table Operations
        • Working with Columns
        • Working with Indexes
        • Changing Table Data
        • Interacting with the Work Queue
        • Error Info and Debugging
    • Debug
    • FilterInput
    • Highlighter
    • IPAddress
    • Jwt
      • JsonWebToken
      • KeyFactory
      • TokenFactory
      • TokenReader
    • Key
      • ArrayStorage
      • Basic
      • FileStorage
      • KeyAbstract
      • StorageInterface
    • Language
    • Metagen
      • Extracting Data
      • Applying Data
    • Module
      • Admin
      • Helper
      • Helper
        • AbstractHelper
        • Cache
        • GenericHelper
        • Permission
        • Session
    • ProxyCheck
    • Random
    • Request
    • StopWords
    • Uuid
    • Yaml
  • Credits
  • License:
  • Table of Content
Powered by GitBook
On this page
  1. Reference
  2. Database

Tables

PreviousTableLoadNextGetting Started

Last updated 6 years ago

Xmf\Database\Tables is a class to simplify creating and modifying database tables. When a module is first installed, there is an automatic mechanism to create the module related tables. For migrations, changes to the schema after installations, there has been no standard solution.

This class is used to build and execute a work queue of statements to modify database tables. The current schema is loaded for each referenced table, and creation of the work queue considers that current state while determining the work to be done (i.e. it will not attempt a CREATE of an existing table.)

All methods with create or alter tables, columns, indexes or data require a table that is already established using addTable() or useTable().

No alterations are made to the database until the work queue is executed by invoking executeQueue().

DDL
Getting Started
Table Operations
Working with Columns
Working with Indexes
Changing Table Data
Interacting with the Work Queue
Error Info and Debugging