Test zu Fake geändert, weil Namensproblem
Dieser Commit ist enthalten in:
@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS customers (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
email TEXT,
|
||||
is_test BOOLEAN DEFAULT FALSE,
|
||||
is_fake BOOLEAN DEFAULT FALSE,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT unique_email UNIQUE (email)
|
||||
);
|
||||
@@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS licenses (
|
||||
valid_from DATE NOT NULL,
|
||||
valid_until DATE NOT NULL,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
is_test BOOLEAN DEFAULT FALSE,
|
||||
is_fake BOOLEAN DEFAULT FALSE,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
@@ -129,7 +129,7 @@ CREATE TABLE IF NOT EXISTS resource_pools (
|
||||
quarantine_until TIMESTAMP WITH TIME ZONE,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||
notes TEXT,
|
||||
is_test BOOLEAN DEFAULT FALSE,
|
||||
is_fake BOOLEAN DEFAULT FALSE,
|
||||
UNIQUE(resource_type, resource_value)
|
||||
);
|
||||
|
||||
@@ -245,48 +245,48 @@ CREATE TABLE IF NOT EXISTS users (
|
||||
CREATE INDEX IF NOT EXISTS idx_users_username ON users(username);
|
||||
CREATE INDEX IF NOT EXISTS idx_users_reset_token ON users(password_reset_token) WHERE password_reset_token IS NOT NULL;
|
||||
|
||||
-- Migration: Add is_test column to licenses if it doesn't exist
|
||||
-- Migration: Add is_fake column to licenses if it doesn't exist
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name = 'licenses' AND column_name = 'is_test') THEN
|
||||
ALTER TABLE licenses ADD COLUMN is_test BOOLEAN DEFAULT FALSE;
|
||||
WHERE table_name = 'licenses' AND column_name = 'is_fake') THEN
|
||||
ALTER TABLE licenses ADD COLUMN is_fake BOOLEAN DEFAULT FALSE;
|
||||
|
||||
-- Mark all existing licenses as test data
|
||||
UPDATE licenses SET is_test = TRUE;
|
||||
-- Mark all existing licenses as fake data
|
||||
UPDATE licenses SET is_fake = TRUE;
|
||||
|
||||
-- Add index for better performance when filtering test data
|
||||
CREATE INDEX idx_licenses_is_test ON licenses(is_test);
|
||||
-- Add index for better performance when filtering fake data
|
||||
CREATE INDEX idx_licenses_is_fake ON licenses(is_fake);
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- Migration: Add is_test column to customers if it doesn't exist
|
||||
-- Migration: Add is_fake column to customers if it doesn't exist
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name = 'customers' AND column_name = 'is_test') THEN
|
||||
ALTER TABLE customers ADD COLUMN is_test BOOLEAN DEFAULT FALSE;
|
||||
WHERE table_name = 'customers' AND column_name = 'is_fake') THEN
|
||||
ALTER TABLE customers ADD COLUMN is_fake BOOLEAN DEFAULT FALSE;
|
||||
|
||||
-- Mark all existing customers as test data
|
||||
UPDATE customers SET is_test = TRUE;
|
||||
-- Mark all existing customers as fake data
|
||||
UPDATE customers SET is_fake = TRUE;
|
||||
|
||||
-- Add index for better performance
|
||||
CREATE INDEX idx_customers_is_test ON customers(is_test);
|
||||
CREATE INDEX idx_customers_is_fake ON customers(is_fake);
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- Migration: Add is_test column to resource_pools if it doesn't exist
|
||||
-- Migration: Add is_fake column to resource_pools if it doesn't exist
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name = 'resource_pools' AND column_name = 'is_test') THEN
|
||||
ALTER TABLE resource_pools ADD COLUMN is_test BOOLEAN DEFAULT FALSE;
|
||||
WHERE table_name = 'resource_pools' AND column_name = 'is_fake') THEN
|
||||
ALTER TABLE resource_pools ADD COLUMN is_fake BOOLEAN DEFAULT FALSE;
|
||||
|
||||
-- Mark all existing resources as test data
|
||||
UPDATE resource_pools SET is_test = TRUE;
|
||||
-- Mark all existing resources as fake data
|
||||
UPDATE resource_pools SET is_fake = TRUE;
|
||||
|
||||
-- Add index for better performance
|
||||
CREATE INDEX idx_resource_pools_is_test ON resource_pools(is_test);
|
||||
CREATE INDEX idx_resource_pools_is_fake ON resource_pools(is_fake);
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren