SQL

CREATE TABLE voucher_pricing  (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  package_name TEXT NOT NULL,
  customer_price DECIMAL(10,2) NOT NULL,
  agent_price DECIMAL(10,2) NOT NULL,
  commission_amount DECIMAL(10,2) NOT NULL,
  duration INTEGER DEFAULT 0,
  -- in hours
    description TEXT,
  is_active BOOLEAN DEFAULT 1,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  hotspot_profile TEXT,
  duration_type TEXT DEFAULT 'hours',
  account_type TEXT DEFAULT 'voucher',
  voucher_digit_type TEXT DEFAULT 'mixed',
  voucher_length INTEGER DEFAULT 8,
  package_id INTEGER,
  duration_hours INTEGER DEFAULT 24,
  price DECIMAL(10,2),
  commission DECIMAL(10,2)
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
id INTEGER Rename | Drop
package_name TEXT Rename | Drop
customer_price DECIMAL(10,2) Rename | Drop
agent_price DECIMAL(10,2) Rename | Drop
commission_amount DECIMAL(10,2) Rename | Drop
duration INTEGER Rename | Drop
description TEXT Rename | Drop
is_active BOOLEAN Rename | Drop
created_at DATETIME Rename | Drop
updated_at DATETIME Rename | Drop
hotspot_profile TEXT Rename | Drop
duration_type TEXT Rename | Drop
account_type TEXT Rename | Drop
voucher_digit_type TEXT Rename | Drop
voucher_length INTEGER Rename | Drop
package_id INTEGER Rename | Drop
duration_hours INTEGER Rename | Drop
price DECIMAL(10,2) Rename | Drop
commission DECIMAL(10,2) Rename | Drop

+ Add index

Indexes

Name Columns Unique SQL Drop?
idx_voucher_pricing_duration duration_hours SQL
CREATE INDEX idx_voucher_pricing_duration
ON voucher_pricing(duration_hours)
Drop
idx_voucher_pricing_package_id package_id SQL
CREATE INDEX idx_voucher_pricing_package_id
ON voucher_pricing(package_id)
Drop