Skip to content

Conversation

@anonymoususer72041
Copy link
Contributor

@anonymoususer72041 anonymoususer72041 commented Dec 27, 2025

Summary

This PR normalizes the initial database state created from db/cats_schema.sql by removing demo/sample tag data, resetting instance-specific seeded values to deterministic defaults, and replacing testdomain.com placeholders with the IANA-reserved placeholder domain example.com.

In addition, it updates modules/install/Schema.php to migrate existing databases where site.last_viewed_day is NULL or 0000-00-00 by backfilling a sentinel date (1000-01-01) and then enforcing a non-null default at the schema level.

Motivation

Fresh installs should start from a clean, deterministic baseline without embedded demo content or leftover environment-specific values. This reduces confusion, makes the initial schema easier to reason about, and avoids noisy diffs when comparing or exporting databases.

Backfilling and normalizing site.last_viewed_day prevents NULL/zero-date edge cases and aligns this field with the sentinel-date approach used elsewhere in the schema while keeping existing instances consistent through an explicit migration step.

Replacing testdomain.com with the IANA-reserved placeholder domain example.com avoids potential confusion with real domains.

@anonymoususer72041
Copy link
Contributor Author

anonymoususer72041 commented Jan 11, 2026

@RussH any chances to merge this PR short term?

I’m currently working on a follow-up PR that removes test.sql to reduce drift and the ongoing effort of maintaining two separate databases. I want to avoid another stacked PR.

@anonymoususer72041
Copy link
Contributor Author

@RussH CI/CD “Tests (PHP 7.2)” is now failing again, and it’s the exact drift issue I mentioned around test.sql.

Behat fails at the very first “Login as administrator” step (“Invalid username or password”), which causes the rest of the scenarios to cascade (missing fields/pages because the suite is stuck on the login screen). The current test/data/test.sql seeds the admin password in a way that no longer matches what the app expects (hashing), so the credentials in test/features/login.feature can’t authenticate.

This is another concrete example of why maintaining both cats_schema.sql and test.sql as separate sources keeps breaking CI whenever one side changes. As a short-term band-aid, I’ll push a minimal fix to re-align the seeded admin password in test.sql with the expected hashing scheme so CI is green again.

After that, I’d really like to start on the follow-up PR that removes test.sql (or replaces it with a generated/derived fixture) to prevent this from recurring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant