First off, thank you for considering contributing to Database Comparison Tool! It's people like you that make this tool better for everyone.
- Code of Conduct
- How Can I Contribute?
- Development Setup
- Pull Request Process
- Style Guidelines
- Reporting Bugs
- Suggesting Enhancements
This project and everyone participating in it is governed by our commitment to creating a welcoming and inclusive environment. By participating, you are expected to uphold this code.
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Before creating bug reports, please check the existing issues to avoid duplicates.
When submitting a bug report, include:
- A clear and descriptive title
- Steps to reproduce the behavior
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Your environment (OS, PHP version, PostgreSQL version)
- Any error messages or logs
Example:
**Title:** Schema comparison fails with special characters in table names
**Steps to Reproduce:**
1. Create a table with special characters (e.g., `user#info`)
2. Run the comparison tool
3. Observe the error
**Expected:** Table should be displayed correctly
**Actual:** Error message appears
**Environment:**
- OS: Ubuntu 22.04
- PHP: 8.1
- PostgreSQL: 14.5Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion:
- Use a clear and descriptive title
- Provide a detailed description of the suggested enhancement
- Explain why this enhancement would be useful
- List any alternative solutions you've considered
Unsure where to begin? Look for issues tagged with:
good first issue- Simple issues for beginnershelp wanted- Issues where we need community helpdocumentation- Improvements to documentation
- PHP 7.4 or higher
- PostgreSQL 9.6 or higher
- Git
-
Fork and clone the repository
git clone https://github.com/yourusername/database-compare.git cd database-compare -
Create configuration
cp config.example.php config.php # Edit config.php with your database credentials -
Create a branch
git checkout -b feature/my-new-feature
-
Start development server
php -S localhost:8000
-
Make your changes
-
Test your changes
- Manually test all affected features
- Ensure no PHP errors in logs
- Test in different browsers (Chrome, Firefox, Safari)
- Test responsive design on mobile
- Update documentation - If you've added features, update README.md
- Follow code style - See Style Guidelines below
- Test thoroughly - Make sure everything works
- Update CHANGELOG.md - Add your changes under "Unreleased"
- Create Pull Request with a clear description
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Tested locally
- [ ] Tested in multiple browsers
- [ ] Tested responsive design
## Checklist
- [ ] Code follows style guidelines
- [ ] Updated documentation
- [ ] Added/updated CHANGELOG.md
- [ ] No new warnings or errors- Follow PSR-12 coding standard
- Use meaningful variable names
- Add comments for complex logic
- Keep functions small and focused
Example:
<?php
// Good
function getUserById($userId) {
// Fetch user from database
$query = "SELECT * FROM users WHERE id = $1";
return pg_query_params($query, [$userId]);
}
// Bad
function get($id) {
return pg_query("SELECT * FROM users WHERE id = " . $id);
}- Use ES6+ features
- Use const/let instead of var
- Use meaningful variable names
- Add JSDoc comments for functions
Example:
// Good
/**
* Toggle schema visibility
* @param {HTMLElement} schemaDiv - Schema DOM element
* @param {string} schemaName - Name of the schema
* @param {string} side - 'local' or 'remote'
*/
function toggleSchema(schemaDiv, schemaName, side) {
// Implementation
}
// Bad
function t(d, n, s) {
// What does this do?
}- Use meaningful class names
- Group related properties
- Add comments for sections
- Keep specificity low
Example:
/* Good */
.table-card {
margin-bottom: 8px;
border-radius: 3px;
border: 1px solid #e5e5e5;
}
/* Bad */
div.table > div { margin: 8px; border: 1px solid #e5e5e5; border-radius: 3px; }- Use present tense ("Add feature" not "Added feature")
- Use imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit first line to 72 characters
- Reference issues and pull requests
Example:
Add MySQL database support
- Implement MySQL connection class
- Add MySQL-specific column type detection
- Update documentation for MySQL setup
Fixes #123
feature/- New features (e.g.,feature/mysql-support)fix/- Bug fixes (e.g.,fix/schema-detection)docs/- Documentation (e.g.,docs/update-readme)refactor/- Code refactoring (e.g.,refactor/database-class)
Before submitting a PR, test:
- Schema comparison works correctly
- Synchronized navigation between local/remote
- Column type detection is accurate
- Responsive design on mobile
- No JavaScript console errors
- No PHP errors or warnings
- Cross-browser compatibility (Chrome, Firefox, Safari)
Feel free to:
- Open an issue with the
questionlabel - Start a discussion in GitHub Discussions
- Contact maintainers directly
Contributors will be recognized in:
- README.md contributors section
- Release notes
- GitHub contributors page
Thank you for contributing! 🎉