mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-02-09 13:03:10 +00:00
Initial commit: Likwid governance platform
- Backend: Rust/Axum with PostgreSQL, plugin architecture - Frontend: Astro with polished UI - Voting methods: Approval, Ranked Choice, Schulze, STAR, Quadratic - Features: Liquid delegation, transparent moderation, structured deliberation - Documentation: User and admin guides in /docs - Deployment: Docker/Podman compose files for production and demo - Demo: Seeded data with 3 communities, 13 users, 7 proposals License: AGPLv3
This commit is contained in:
commit
910a6465f2
483 changed files with 61980 additions and 0 deletions
1
.dev/dev-token.txt
Normal file
1
.dev/dev-token.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNWRjNGQ2OS1mOGMxLTRjNTEtYTE2Yy1iMThhYzIyMmNkMzEiLCJ1c2VybmFtZSI6ImRldmFkbWluIiwiZXhwIjoxNzY5NTA1MjA2LCJpYXQiOjE3Njk0MTg4MDZ9.eWgwHPFLUE71RNi8KF1rDkOtECLxRsal6rnl0hMQfZQ
|
||||||
1
.dev/pids/backend.pid
Normal file
1
.dev/pids/backend.pid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
10488
|
||||||
1
.dev/pids/frontend.pid
Normal file
1
.dev/pids/frontend.pid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
12944
|
||||||
4
.env.example
Normal file
4
.env.example
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
DATABASE_URL=postgres://likwid:likwid@localhost:5432/likwid
|
||||||
|
POSTGRES_USER=likwid
|
||||||
|
POSTGRES_PASSWORD=likwid
|
||||||
|
POSTGRES_DB=likwid
|
||||||
49
.gitignore
vendored
Normal file
49
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
# Rust
|
||||||
|
/backend/target/
|
||||||
|
**/*.rs.bk
|
||||||
|
Cargo.lock
|
||||||
|
|
||||||
|
# Node
|
||||||
|
/frontend/node_modules/
|
||||||
|
/frontend/dist/
|
||||||
|
/frontend/.astro/
|
||||||
|
|
||||||
|
# Environment
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
backend/.env
|
||||||
|
|
||||||
|
# Development state
|
||||||
|
.dev/
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# OS
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
|
||||||
|
# Podman
|
||||||
|
.podman/
|
||||||
|
|
||||||
|
# Internal development documentation (not for public)
|
||||||
|
/docu_dev/
|
||||||
|
|
||||||
|
# Compose environment files (contain secrets)
|
||||||
|
/compose/.env.production
|
||||||
|
/compose/.env.demo
|
||||||
|
|
||||||
|
# Database
|
||||||
|
*.sql.backup
|
||||||
|
|
||||||
|
# Build artifacts
|
||||||
|
*.dump
|
||||||
|
*.dump.gz
|
||||||
208
CONTRIBUTING.md
Normal file
208
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,208 @@
|
||||||
|
# Contributing to Likwid
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Development Environment
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
|
**All Platforms:**
|
||||||
|
- Git
|
||||||
|
- Rust (via rustup) — latest stable
|
||||||
|
- Node.js LTS (20.x+)
|
||||||
|
- Podman (for database)
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
- WSL2 enabled
|
||||||
|
- Podman Desktop with WSL2 backend
|
||||||
|
- MSVC toolchain for Rust
|
||||||
|
|
||||||
|
**Linux:**
|
||||||
|
- podman-compose
|
||||||
|
|
||||||
|
### Quick Setup
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone the repository
|
||||||
|
git clone https://codeberg.org/likwid/likwid
|
||||||
|
cd likwid
|
||||||
|
|
||||||
|
# Copy environment configuration
|
||||||
|
cp .env.example .env
|
||||||
|
|
||||||
|
# Start development environment
|
||||||
|
# Windows:
|
||||||
|
.\scripts\dev-start.ps1
|
||||||
|
|
||||||
|
# Linux:
|
||||||
|
./scripts/dev-start.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
likwid/
|
||||||
|
├── backend/ # Rust backend (Axum)
|
||||||
|
│ ├── src/
|
||||||
|
│ │ ├── api/ # HTTP endpoints
|
||||||
|
│ │ ├── auth/ # Authentication
|
||||||
|
│ │ ├── models/ # Database models
|
||||||
|
│ │ └── plugins/ # Plugin system
|
||||||
|
│ └── migrations/ # SQLx migrations
|
||||||
|
├── frontend/ # Astro frontend
|
||||||
|
│ └── src/
|
||||||
|
│ ├── pages/ # Routes
|
||||||
|
│ ├── layouts/ # Page templates
|
||||||
|
│ └── components/# Reusable UI
|
||||||
|
├── scripts/ # Dev scripts
|
||||||
|
└── compose/ # Container configs
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development Workflow
|
||||||
|
|
||||||
|
### Branch Naming
|
||||||
|
|
||||||
|
- `feature/description` — New features
|
||||||
|
- `fix/description` — Bug fixes
|
||||||
|
- `docs/description` — Documentation
|
||||||
|
- `refactor/description` — Code refactoring
|
||||||
|
|
||||||
|
```
|
||||||
|
type(scope): description
|
||||||
|
|
||||||
|
[optional body]
|
||||||
|
|
||||||
|
[optional footer]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Types:** `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
|
||||||
|
|
||||||
|
**Examples:**
|
||||||
|
```
|
||||||
|
feat(voting): implement Schulze method
|
||||||
|
fix(auth): correct JWT expiration handling
|
||||||
|
docs(readme): add Voting System info
|
||||||
|
```
|
||||||
|
|
||||||
|
### Code Style
|
||||||
|
|
||||||
|
#### Rust (Backend)
|
||||||
|
|
||||||
|
- Follow `rustfmt` defaults
|
||||||
|
- Use `clippy` for linting
|
||||||
|
- Document public APIs with `///` comments
|
||||||
|
- Prefer `Result<T, E>` over panics
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd backend
|
||||||
|
cargo fmt --check
|
||||||
|
cargo clippy
|
||||||
|
```
|
||||||
|
|
||||||
|
#### TypeScript (Frontend)
|
||||||
|
|
||||||
|
- Strict mode enabled
|
||||||
|
- Use TypeScript for all new code
|
||||||
|
- Follow Astro conventions
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd frontend
|
||||||
|
npm run check
|
||||||
|
```
|
||||||
|
|
||||||
|
### Testing
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Backend tests
|
||||||
|
cd backend
|
||||||
|
cargo test
|
||||||
|
|
||||||
|
# Frontend checks
|
||||||
|
cd frontend
|
||||||
|
npm run check
|
||||||
|
```
|
||||||
|
|
||||||
|
### Database Migrations
|
||||||
|
|
||||||
|
We use SQLx for compile-time checked queries:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd backend
|
||||||
|
|
||||||
|
# Create a new migration
|
||||||
|
sqlx migrate add description_of_change
|
||||||
|
|
||||||
|
# Run migrations
|
||||||
|
sqlx migrate run
|
||||||
|
|
||||||
|
# Prepare offline query data (for CI)
|
||||||
|
cargo sqlx prepare
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing Guidelines
|
||||||
|
|
||||||
|
### Before You Start
|
||||||
|
|
||||||
|
1. **Check existing issues** — Someone may already be working on it
|
||||||
|
2. **Open an issue first** — For significant changes, discuss before coding
|
||||||
|
3. **Keep changes focused** — One feature/fix per merge request
|
||||||
|
|
||||||
|
### Submitting Changes
|
||||||
|
|
||||||
|
1. Fork the repository
|
||||||
|
2. Create a feature branch
|
||||||
|
3. Make your changes
|
||||||
|
4. Ensure tests pass
|
||||||
|
5. Submit a merge request
|
||||||
|
|
||||||
|
### Merge Request Checklist
|
||||||
|
|
||||||
|
- [ ] Code follows project style
|
||||||
|
- [ ] Tests added/updated
|
||||||
|
- [ ] Documentation updated
|
||||||
|
- [ ] Commit messages follow conventions
|
||||||
|
- [ ] No unrelated changes
|
||||||
|
|
||||||
|
|
||||||
|
### Find a Third Way
|
||||||
|
|
||||||
|
When opinions conflict, seek solutions that satisfy everyone rather than taking sides. The best outcomes come from understanding all perspectives.
|
||||||
|
|
||||||
|
### Be Pragmatic
|
||||||
|
|
||||||
|
We value tangible results over theoretical debates. If something works and improves the project, it's worth considering.
|
||||||
|
|
||||||
|
### Support Each Other
|
||||||
|
|
||||||
|
Help newcomers, answer questions patiently, and remember that everyone was new once.
|
||||||
|
|
||||||
|
## Areas for Contribution
|
||||||
|
|
||||||
|
### High Priority
|
||||||
|
- Advanced voting methods (Schulze, STAR, Quadratic)
|
||||||
|
- Liquid delegation engine
|
||||||
|
- Accessibility improvements
|
||||||
|
- Mobile responsiveness
|
||||||
|
- Internationalization (i18n)
|
||||||
|
|
||||||
|
### Plugin Development
|
||||||
|
- Create new plugins for the WASM runtime
|
||||||
|
- Improve plugin documentation
|
||||||
|
- Build integrations (GitLab, Matrix, etc.)
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
- User guides
|
||||||
|
- API documentation
|
||||||
|
- Tutorial videos
|
||||||
|
- Translations
|
||||||
|
|
||||||
|
### Design
|
||||||
|
- UI/UX improvements
|
||||||
|
- Icon design
|
||||||
|
- Theme development
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
By contributing, you agree that your contributions will be licensed under LGPL-2.1-or-later.
|
||||||
|
|
||||||
|
---
|
||||||
188
DEPLOYMENT.md
Normal file
188
DEPLOYMENT.md
Normal file
|
|
@ -0,0 +1,188 @@
|
||||||
|
# Likwid Deployment Guide
|
||||||
|
|
||||||
|
Likwid supports two distinct deployment modes: **Production** and **Demo**. These are separate instances with their own databases.
|
||||||
|
|
||||||
|
## Architecture Overview
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
|
│ PRODUCTION │
|
||||||
|
│ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
|
||||||
|
│ │ Frontend │───▶│ Backend │───▶│ PostgreSQL (prod_db) │ │
|
||||||
|
│ │ :4321 │ │ :3000 │ │ :5432 │ │
|
||||||
|
│ └──────────┘ └──────────┘ └──────────────────────┘ │
|
||||||
|
│ DEMO_MODE=false │ No demo data │ Clean database │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
┌─────────────────────────────────────────────────────────────────┐
|
||||||
|
│ DEMO │
|
||||||
|
│ ┌──────────┐ ┌──────────┐ ┌──────────────────────┐ │
|
||||||
|
│ │ Frontend │───▶│ Backend │───▶│ PostgreSQL (demo_db) │ │
|
||||||
|
│ │ :4322 │ │ :3001 │ │ :5433 │ │
|
||||||
|
│ └──────────┘ └──────────┘ └──────────────────────┘ │
|
||||||
|
│ DEMO_MODE=true │ Seed data │ Resettable database │
|
||||||
|
└─────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
### Production Deployment
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Copy and configure environment
|
||||||
|
cp compose/.env.production.example compose/.env.production
|
||||||
|
|
||||||
|
# 2. Edit .env.production with secure values
|
||||||
|
# - Set strong POSTGRES_PASSWORD
|
||||||
|
# - Set random JWT_SECRET (64+ chars)
|
||||||
|
# - Set your domain in API_BASE
|
||||||
|
|
||||||
|
# 3. Remove demo seed migration (important!)
|
||||||
|
rm backend/migrations/20260127150000_demo_seed_data.sql
|
||||||
|
|
||||||
|
# 4. Deploy
|
||||||
|
cd compose
|
||||||
|
podman-compose --env-file .env.production -f production.yml up -d
|
||||||
|
|
||||||
|
# 5. Access at http://localhost:4321
|
||||||
|
```
|
||||||
|
|
||||||
|
### Demo Deployment
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Copy environment (defaults are fine for demo)
|
||||||
|
cp compose/.env.demo.example compose/.env.demo
|
||||||
|
|
||||||
|
# 2. Deploy
|
||||||
|
cd compose
|
||||||
|
podman-compose --env-file .env.demo -f demo.yml up -d
|
||||||
|
|
||||||
|
# 3. Access at http://localhost:4322
|
||||||
|
```
|
||||||
|
|
||||||
|
## Demo Instance Details
|
||||||
|
|
||||||
|
### Demo Accounts
|
||||||
|
|
||||||
|
| Username | Password | Role |
|
||||||
|
|-------------|----------|------------------------------|
|
||||||
|
| contributor | demo123 | Standard member |
|
||||||
|
| moderator | demo123 | Can moderate content |
|
||||||
|
| observer | demo123 | Read-only access |
|
||||||
|
|
||||||
|
### Pre-seeded Data
|
||||||
|
|
||||||
|
- **3 Communities**
|
||||||
|
- Aurora Framework (tech/OSS governance)
|
||||||
|
- Civic Commons Network (civic engagement)
|
||||||
|
- Regional Makers Collective (federated makerspaces)
|
||||||
|
|
||||||
|
- **13 Users** with realistic profiles
|
||||||
|
|
||||||
|
- **7 Proposals** in various states (draft, discussion, voting, closed)
|
||||||
|
|
||||||
|
- **Delegation relationships** demonstrating liquid democracy
|
||||||
|
|
||||||
|
- **Moderation history** showing governance in action
|
||||||
|
|
||||||
|
### Resetting Demo
|
||||||
|
|
||||||
|
To reset the demo to a clean state:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Windows
|
||||||
|
.\scripts\demo-reset.ps1
|
||||||
|
|
||||||
|
# Linux/macOS
|
||||||
|
./scripts/demo-reset.sh
|
||||||
|
|
||||||
|
# Or manually:
|
||||||
|
podman-compose -f compose/demo.yml down -v
|
||||||
|
podman-compose --env-file .env.demo -f compose/demo.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration Reference
|
||||||
|
|
||||||
|
### Environment Variables
|
||||||
|
|
||||||
|
| Variable | Production Default | Demo Default | Description |
|
||||||
|
|-------------------|-------------------|---------------------------|--------------------------------|
|
||||||
|
| POSTGRES_USER | likwid | likwid_demo | Database username |
|
||||||
|
| POSTGRES_PASSWORD | (required) | demo_secret_change_me | Database password |
|
||||||
|
| POSTGRES_DB | likwid_prod | likwid_demo | Database name |
|
||||||
|
| DB_PORT | 5432 | 5433 | Database port |
|
||||||
|
| JWT_SECRET | (required) | demo_jwt_secret_... | JWT signing secret |
|
||||||
|
| BACKEND_PORT | 3000 | 3001 | Backend API port |
|
||||||
|
| FRONTEND_PORT | 4321 | 4322 | Frontend port |
|
||||||
|
| API_BASE | (your domain) | http://localhost:3001 | Public API URL |
|
||||||
|
| DEMO_MODE | false | true | Enable demo features |
|
||||||
|
|
||||||
|
### Demo Mode Features
|
||||||
|
|
||||||
|
When `DEMO_MODE=true`:
|
||||||
|
- Demo accounts are recognized and can log in
|
||||||
|
- Destructive actions on demo data are restricted
|
||||||
|
- Reset endpoint available at `/api/demo/reset` (admin only)
|
||||||
|
- Demo status shown at `/api/demo/status`
|
||||||
|
|
||||||
|
## Development Setup
|
||||||
|
|
||||||
|
For local development without containers:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. Start only the database
|
||||||
|
podman-compose -f compose/dev.yml up -d
|
||||||
|
|
||||||
|
# 2. Run backend natively
|
||||||
|
cd backend
|
||||||
|
cp ../.env.example .env # Configure DATABASE_URL
|
||||||
|
cargo run
|
||||||
|
|
||||||
|
# 3. Run frontend natively
|
||||||
|
cd frontend
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Monitoring & Logs
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# View all logs
|
||||||
|
podman-compose -f compose/demo.yml logs -f
|
||||||
|
|
||||||
|
# View specific service
|
||||||
|
podman-compose -f compose/demo.yml logs -f backend
|
||||||
|
|
||||||
|
# Check health
|
||||||
|
curl http://localhost:3001/health
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Database connection issues
|
||||||
|
```bash
|
||||||
|
# Check if postgres is running
|
||||||
|
podman-compose -f compose/demo.yml ps
|
||||||
|
|
||||||
|
# View postgres logs
|
||||||
|
podman-compose -f compose/demo.yml logs postgres
|
||||||
|
```
|
||||||
|
|
||||||
|
### Migration failures
|
||||||
|
```bash
|
||||||
|
# Connect to database and check
|
||||||
|
podman exec -it likwid-demo-db psql -U likwid_demo -d likwid_demo
|
||||||
|
|
||||||
|
# List tables
|
||||||
|
\dt
|
||||||
|
|
||||||
|
# Check migration status
|
||||||
|
SELECT * FROM _sqlx_migrations;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Reset everything
|
||||||
|
```bash
|
||||||
|
# Nuclear option - removes all data and volumes
|
||||||
|
podman-compose -f compose/demo.yml down -v
|
||||||
|
podman volume prune -f
|
||||||
|
podman-compose -f compose/demo.yml up -d
|
||||||
|
```
|
||||||
158
README.md
Normal file
158
README.md
Normal file
|
|
@ -0,0 +1,158 @@
|
||||||
|
# Likwid - Modular Governance Platform
|
||||||
|
|
||||||
|
**Democracy Design in Practice**
|
||||||
|
|
||||||
|
Likwid is an open-source platform for participatory governance, designed to make collective decision-making accessible, transparent, and genuinely democratic. Built for communities, civic organizations, and any group that values structured deliberation over shouting matches.
|
||||||
|
|
||||||
|
> *"We are citizens of the 21st century, but we rely on institutions designed in the 19th century. The problem is not democracy, it's the interface."*
|
||||||
|
|
||||||
|
## Philosophy
|
||||||
|
|
||||||
|
Likwid implements the principles of **Democracy Design**:
|
||||||
|
|
||||||
|
- **Information must be understandable**, not just available
|
||||||
|
- **Listening matters more than speaking** — structured deliberation over flame wars
|
||||||
|
- **Voting should express nuance** — from simple approval to Schulze and quadratic methods
|
||||||
|
- **Delegation should be fluid** — trust networks that adapt in real-time
|
||||||
|
- **Participation is designed**, not imposed
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
### Deliberative Democracy
|
||||||
|
- **Inform → Discuss → Decide** workflow for proposals
|
||||||
|
- Resource libraries for informed participation
|
||||||
|
- Small group discussions with facilitators
|
||||||
|
- "Read before discuss" requirements
|
||||||
|
- Constructive comment visibility scoring
|
||||||
|
|
||||||
|
### Advanced Voting Methods
|
||||||
|
- **Approval Voting** — vote for multiple options
|
||||||
|
- **Ranked Choice** — order preferences
|
||||||
|
- **Schulze Method** — Condorcet-consistent pairwise comparison
|
||||||
|
- **STAR Voting** — score + automatic runoff
|
||||||
|
- **Quadratic Voting** — express intensity of preference
|
||||||
|
|
||||||
|
### Liquid Delegation
|
||||||
|
- Delegate your vote by topic or globally
|
||||||
|
- Real-time transparency: see how delegates vote
|
||||||
|
- Revoke delegation instantly
|
||||||
|
- Transitive delegation chains
|
||||||
|
- Delegation analytics and trust networks
|
||||||
|
|
||||||
|
### Modular Plugin System
|
||||||
|
- WASM-based sandboxed plugins
|
||||||
|
- Per-community plugin configuration
|
||||||
|
- Hook-based architecture (actions/filters)
|
||||||
|
- Built-in and third-party plugins
|
||||||
|
- Admin policy for signed/unsigned plugins
|
||||||
|
|
||||||
|
### Governance Infrastructure
|
||||||
|
- Multi-community platform support
|
||||||
|
- Granular admin controls (platform mode, registration, moderation)
|
||||||
|
- Public moderation ledger (immutable)
|
||||||
|
- Role-based access (admin, moderator, facilitator, member)
|
||||||
|
- Anonymous voting with identity separation
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
|
||||||
|
| Layer | Technology |
|
||||||
|
|-------|------------|
|
||||||
|
| **Backend** | Rust (Axum 0.8, Tokio, SQLx) |
|
||||||
|
| **Frontend** | Astro + TypeScript |
|
||||||
|
| **Database** | PostgreSQL 16 |
|
||||||
|
| **Plugins** | WebAssembly (wasmtime) |
|
||||||
|
| **Containers** | Podman (rootless) |
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
- Windows 10/11 with WSL2
|
||||||
|
- Podman Desktop (WSL2 backend)
|
||||||
|
- Rust (rustup, MSVC toolchain)
|
||||||
|
- Node.js LTS
|
||||||
|
|
||||||
|
**Linux:**
|
||||||
|
- Podman + podman-compose
|
||||||
|
- Rust (rustup)
|
||||||
|
- Node.js LTS
|
||||||
|
|
||||||
|
### Development
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
# 1. Clone and configure
|
||||||
|
git clone https://invent.kde.org/marcoa/likwid.git
|
||||||
|
cd likwid
|
||||||
|
cp .env.example .env
|
||||||
|
|
||||||
|
# 2. Start everything (database + backend + frontend)
|
||||||
|
.\scripts\dev-start.ps1
|
||||||
|
|
||||||
|
# 3. Stop everything
|
||||||
|
.\scripts\dev-stop.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
The platform will be available at:
|
||||||
|
- **Frontend**: http://localhost:4321
|
||||||
|
- **Backend API**: http://localhost:3000
|
||||||
|
- **Setup Wizard**: http://localhost:4321/setup (first run)
|
||||||
|
|
||||||
|
### First Run
|
||||||
|
|
||||||
|
1. Navigate to `/register` to create the first user (automatically becomes admin)
|
||||||
|
2. Complete platform setup at `/setup`
|
||||||
|
3. Configure instance settings at `/admin/settings`
|
||||||
|
4. Create your first community
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
likwid/
|
||||||
|
├── backend/ # Rust backend
|
||||||
|
│ ├── src/
|
||||||
|
│ │ ├── api/ # REST endpoints
|
||||||
|
│ │ ├── auth/ # JWT authentication
|
||||||
|
│ │ ├── models/ # Database models
|
||||||
|
│ │ └── plugins/ # Plugin system (WASM + builtins)
|
||||||
|
│ └── migrations/ # SQL migrations
|
||||||
|
├── frontend/ # Astro frontend
|
||||||
|
│ ├── src/
|
||||||
|
│ │ ├── pages/ # Routes
|
||||||
|
│ │ ├── layouts/ # Page layouts
|
||||||
|
│ │ └── components/ # UI components
|
||||||
|
├── compose/ # Podman compose files
|
||||||
|
├── scripts/ # Dev scripts (cross-platform)
|
||||||
|
└── docu_dev/ # Design documents
|
||||||
|
```
|
||||||
|
|
||||||
|
### Core Principles
|
||||||
|
|
||||||
|
1. **Be considerate** — Your work affects others
|
||||||
|
2. **Be respectful** — Assume good intentions
|
||||||
|
3. **Be collaborative** — Work transparently
|
||||||
|
4. **Be pragmatic** — Results over debates
|
||||||
|
5. **Find a third way** — Seek solutions that satisfy everyone
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
- [x] Core voting infrastructure
|
||||||
|
- [x] Plugin system (WASM + builtins)
|
||||||
|
- [x] Deliberation phases
|
||||||
|
- [x] Comment quality scoring
|
||||||
|
- [ ] Advanced voting methods (Schulze, STAR, Quadratic)
|
||||||
|
- [ ] Liquid delegation engine
|
||||||
|
- [ ] GitLab/GitHub integration - plugin
|
||||||
|
- [ ] Mobile-responsive UI
|
||||||
|
- [ ] Accessibility audit (WCAG 2.1)
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
LGPL-2.1-or-later
|
||||||
|
## Acknowledgments
|
||||||
|
|
||||||
|
Inspired by:
|
||||||
|
- [Pol.is](https://pol.is/) — Opinion mapping
|
||||||
|
- [Decidim](https://decidim.org/) — Participatory democracy
|
||||||
|
- [LiquidFeedback](https://liquidfeedback.org/) — Liquid democracy
|
||||||
|
- [Equal Vote Coalition](https://www.equal.vote/) — STAR Voting
|
||||||
125
WORKFLOW.md
Normal file
125
WORKFLOW.md
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
# Likwid Development Workflow
|
||||||
|
|
||||||
|
## Understanding the Architecture
|
||||||
|
|
||||||
|
```
|
||||||
|
┌─────────────────────────────────────────────────────────────┐
|
||||||
|
│ SHARED CODEBASE │
|
||||||
|
│ backend/src/* frontend/src/* migrations/* │
|
||||||
|
└─────────────────────────────────────────────────────────────┘
|
||||||
|
│
|
||||||
|
┌───────────────┴───────────────┐
|
||||||
|
▼ ▼
|
||||||
|
┌─────────────────────┐ ┌─────────────────────┐
|
||||||
|
│ PRODUCTION DB │ │ DEMO DB │
|
||||||
|
│ (likwid_prod) │ │ (likwid_demo) │
|
||||||
|
│ │ │ │
|
||||||
|
│ - No demo users │ │ - Demo users seeded │
|
||||||
|
│ - No seed data │ │ - Full sample data │
|
||||||
|
│ - DEMO_MODE=false │ │ - DEMO_MODE=true │
|
||||||
|
│ - Real user data │ │ - Resettable │
|
||||||
|
└─────────────────────┘ └─────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
**Key insight**: Code changes affect both. Data is separate.
|
||||||
|
|
||||||
|
## Daily Development Workflow
|
||||||
|
|
||||||
|
### Your current setup IS the demo
|
||||||
|
Your local environment with `DEMO_MODE=true` and the seeded database is functionally equivalent to the demo deployment.
|
||||||
|
|
||||||
|
### Making code changes
|
||||||
|
1. Edit code normally
|
||||||
|
2. Backend auto-reloads (or `cargo run`)
|
||||||
|
3. Frontend hot-reloads (`npm run dev`)
|
||||||
|
4. Test with demo accounts
|
||||||
|
|
||||||
|
### Testing as different users
|
||||||
|
```
|
||||||
|
contributor / demo123 → Standard member experience
|
||||||
|
moderator / demo123 → Moderation features
|
||||||
|
observer / demo123 → Read-only experience
|
||||||
|
```
|
||||||
|
|
||||||
|
## When You Want a Fresh Demo
|
||||||
|
|
||||||
|
### Option 1: Reset database (quick)
|
||||||
|
```powershell
|
||||||
|
# Drop and recreate database
|
||||||
|
cd backend
|
||||||
|
sqlx database drop -y
|
||||||
|
sqlx database create
|
||||||
|
sqlx migrate run
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 2: Use the reset script (when using containers)
|
||||||
|
```powershell
|
||||||
|
.\scripts\demo-reset.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deploying for Others
|
||||||
|
|
||||||
|
### For testers/curious users (Demo)
|
||||||
|
```bash
|
||||||
|
# Uses separate database on port 5433, backend on 3001, frontend on 4322
|
||||||
|
cp compose/.env.demo.example compose/.env.demo
|
||||||
|
podman-compose --env-file compose/.env.demo -f compose/demo.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### For real users (Production)
|
||||||
|
```bash
|
||||||
|
# 1. Remove demo seed data
|
||||||
|
rm backend/migrations/20260127150000_demo_seed_data.sql
|
||||||
|
|
||||||
|
# 2. Configure production
|
||||||
|
cp compose/.env.production.example compose/.env.production
|
||||||
|
# Edit with secure passwords and your domain
|
||||||
|
|
||||||
|
# 3. Deploy
|
||||||
|
podman-compose --env-file compose/.env.production -f compose/production.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## Common Tasks
|
||||||
|
|
||||||
|
### "I broke the demo data"
|
||||||
|
```powershell
|
||||||
|
cd backend
|
||||||
|
sqlx database drop -y && sqlx database create && sqlx migrate run
|
||||||
|
```
|
||||||
|
|
||||||
|
### "I want to test production-like (no demo data)"
|
||||||
|
```powershell
|
||||||
|
# Temporarily move the demo migration
|
||||||
|
mv backend/migrations/20260127150000_demo_seed_data.sql backend/migrations/20260127150000_demo_seed_data.sql.bak
|
||||||
|
|
||||||
|
# Reset database
|
||||||
|
sqlx database drop -y && sqlx database create && sqlx migrate run
|
||||||
|
|
||||||
|
# Set DEMO_MODE=false in .env
|
||||||
|
```
|
||||||
|
|
||||||
|
### "I want demo data back"
|
||||||
|
```powershell
|
||||||
|
# Restore migration
|
||||||
|
mv backend/migrations/20260127150000_demo_seed_data.sql.bak backend/migrations/20260127150000_demo_seed_data.sql
|
||||||
|
|
||||||
|
# Reset database
|
||||||
|
sqlx database drop -y && sqlx database create && sqlx migrate run
|
||||||
|
|
||||||
|
# Set DEMO_MODE=true in .env
|
||||||
|
```
|
||||||
|
|
||||||
|
### "I want to run both demo and production locally"
|
||||||
|
Use the container deployments - they use different ports:
|
||||||
|
- Demo: localhost:4322 (frontend), localhost:3001 (backend)
|
||||||
|
- Prod: localhost:4321 (frontend), localhost:3000 (backend)
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
| Concern | Solution |
|
||||||
|
|---------|----------|
|
||||||
|
| Code changes affect demo? | Yes, same codebase. That's expected. |
|
||||||
|
| Data separation | Different databases (demo vs prod) |
|
||||||
|
| Reset demo | `sqlx database drop && create && migrate` |
|
||||||
|
| Test production locally | Remove demo migration, set DEMO_MODE=false |
|
||||||
|
| Deploy for others | Use compose files with separate DBs |
|
||||||
26
backend/.env.example
Normal file
26
backend/.env.example
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Likwid Backend Configuration
|
||||||
|
# Copy this file to .env and configure as needed
|
||||||
|
|
||||||
|
# Database connection URL
|
||||||
|
DATABASE_URL=postgres://likwid:likwid@localhost:5432/likwid
|
||||||
|
|
||||||
|
# Server configuration
|
||||||
|
SERVER_HOST=127.0.0.1
|
||||||
|
SERVER_PORT=3000
|
||||||
|
|
||||||
|
# JWT Secret for authentication tokens
|
||||||
|
# IMPORTANT: Change this in production!
|
||||||
|
JWT_SECRET=change-me-in-production
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# DEMO MODE
|
||||||
|
# =============================================================================
|
||||||
|
# Enable demo mode for public demonstration instances.
|
||||||
|
# When enabled:
|
||||||
|
# - Restricts destructive actions (delete communities, modify instance settings)
|
||||||
|
# - Enables demo accounts (contributor, moderator, observer) with password: demo123
|
||||||
|
# - Loads seed data with realistic governance history
|
||||||
|
# - Data can be reset via POST /api/demo/reset
|
||||||
|
#
|
||||||
|
# Set to true for demo/showcase instances, false for production
|
||||||
|
DEMO_MODE=false
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO amendment_support (amendment_id, user_id, support_type, comment)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (amendment_id, user_id) DO UPDATE SET\n support_type = $3,\n comment = $4",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "00649c07335338a85657781bfe97b299039883e1170687d60047ced9f3271b8f"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n SELECT DISTINCT pp.id, pp.name, pp.wasm_bytes, pp.manifest\n FROM plugin_packages pp\n JOIN community_plugin_packages cpp ON cpp.package_id = pp.id\n WHERE cpp.is_active = true\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "wasm_bytes",
|
||||||
|
"type_info": "Bytea"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "manifest",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "00b25a5d76ada968ebb490cdfa9b30d82de7402bda296872eb4a366bd2942640"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO notifications (user_id, type, title, message, link) VALUES ($1, $2, $3, $4, $5)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Varchar",
|
||||||
|
"Text",
|
||||||
|
"Varchar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "00c90349026ba6858b28e413cff2e1b71f87d06dea5759fb6159da22a995e341"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,151 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id, community_id, author_id, title, description, \n status as \"status: _\", voting_method, voting_starts_at, voting_ends_at,\n created_at, updated_at, deliberation_phase as \"deliberation_phase: _\",\n inform_starts_at, inform_ends_at, discuss_starts_at, discuss_ends_at,\n min_read_time_seconds, facilitator_id\n FROM proposals \n WHERE community_id = $1 \n ORDER BY created_at DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "author_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "status: _",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "proposal_status",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"draft",
|
||||||
|
"discussion",
|
||||||
|
"voting",
|
||||||
|
"closed",
|
||||||
|
"archived",
|
||||||
|
"calculating"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "voting_method",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "voting_starts_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "voting_ends_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 10,
|
||||||
|
"name": "updated_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 11,
|
||||||
|
"name": "deliberation_phase: _",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "deliberation_phase",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"drafting",
|
||||||
|
"informing",
|
||||||
|
"discussing",
|
||||||
|
"voting",
|
||||||
|
"concluded"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 12,
|
||||||
|
"name": "inform_starts_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 13,
|
||||||
|
"name": "inform_ends_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 14,
|
||||||
|
"name": "discuss_starts_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 15,
|
||||||
|
"name": "discuss_ends_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 16,
|
||||||
|
"name": "min_read_time_seconds",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 17,
|
||||||
|
"name": "facilitator_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "00e2f11aa7f20e01f9a9de158b81fbcd5a33511135ce3e05aea3c8c8846239b3"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO rule_violations (\n community_id, rule_id, target_user_id, \n reported_by, report_reason, report_evidence\n ) VALUES ($1, $2, $3, $4, $5, $6)\n RETURNING id",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Text",
|
||||||
|
"Jsonb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "03706c8c7d9db6d3112ccbd27fd026308c5a03a923f53331468cc899eff9a08d"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT user_has_permission($1, $2, $3)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "user_has_permission",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "03b9920a00f57083543abd69b18965bdb37d21ba503691cd054ed06f6807d7f7"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id, community_id, name, slug, description, parent_id\n FROM topics\n WHERE community_id = $1\n ORDER BY name",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "slug",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "parent_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "0474f023ed456e56e6a744f8a94e4afc361456a4979e1d14378d1f475c1b2192"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n SELECT id, type as notification_type, title, message, link, is_read, created_at\n FROM notifications\n WHERE user_id = $1\n ORDER BY created_at DESC\n LIMIT 50\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "notification_type",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "message",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "link",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "is_read",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "04c1f2a6a596b9cda5a0744b941777916a3aa3c03445ce59a5a3a69f869078de"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO deliberation_reading_log (proposal_id, user_id, first_read_at, reading_time_seconds)\n VALUES ($1, $2, NOW(), $3)\n ON CONFLICT (proposal_id, user_id) DO UPDATE SET\n read_proposal = CASE WHEN $4 = 'proposal' THEN true ELSE deliberation_reading_log.read_proposal END,\n read_summaries = CASE WHEN $4 = 'summaries' THEN true ELSE deliberation_reading_log.read_summaries END,\n read_top_arguments = CASE WHEN $4 = 'arguments' THEN true ELSE deliberation_reading_log.read_top_arguments END,\n reading_time_seconds = deliberation_reading_log.reading_time_seconds + $3,\n updated_at = NOW()",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Int4",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "0569967ce647a065b60b93a233bd222d7dc8aef1eeffec8796dae06968faf08d"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n SELECT c.* FROM communities c\n JOIN community_members cm ON c.id = cm.community_id\n WHERE cm.user_id = $1 AND c.is_active = true\n ORDER BY cm.joined_at DESC\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "slug",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "settings",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "updated_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "is_active",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "created_by",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "05ab322014e6f15af99d2af3c118f0cf64b06f311b17ff3c7197d949bab2a580"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n id, community_id, title, description,\n conflict_type::text AS \"conflict_type!\",\n status::text AS \"status!\",\n severity_level, is_urgent\n FROM conflict_cases WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "conflict_type!",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "status!",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "severity_level",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "is_urgent",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "05d8db279bba917c2456ca3427876caefc67b9b6a3d9031ab43f998462a75a58"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO compromise_proposals (\n conflict_id, title, description, proposed_actions,\n proposed_by, proposed_by_role\n ) VALUES ($1, $2, $3, $4, $5, $6)\n RETURNING id",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Text",
|
||||||
|
"Jsonb",
|
||||||
|
"Uuid",
|
||||||
|
"Varchar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "06415d7e9b1b54bc96b8c35b6c92649ffe74f1d9047c783810c344c75f3b10af"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT author_id, facilitator_id FROM proposals WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "author_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "facilitator_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "06c276dfa8e0d19cf539d9abdd4699b387c4a8435c11ac1fe7c4a53d5c231ba6"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT allow_community_vote FROM community_rules WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "allow_community_vote",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "075e3c636c51526e7ceab5540cccd87e52939da3a48e4a544fe67457e8de6962"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO quadratic_votes (proposal_id, voter_id, option_id, credits) VALUES ($1, $2, $3, $4)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Int4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "098ff8cc94787edf79a98396716cb5296547c407516489b5b873dadfa360f91e"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id FROM workflow_templates \n WHERE community_id = $1 AND is_default = true\n LIMIT 1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "09e0a994d85ba6589db1c989f193ef10e081ccc560031a056e80cb19436f5e8e"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT setup_completed FROM instance_settings LIMIT 1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "setup_completed",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "0cec90f8ac9b48f22ca24330afb16c9308998ddd30404d2a1eb38bd8d0fa46be"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT registration_enabled, registration_mode FROM instance_settings LIMIT 1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "registration_enabled",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "registration_mode",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "0d3765f6d5135140d623f9dc706b6907686b98158d775978709db26486109d8b"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT is_core FROM default_plugins WHERE plugin_name = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "is_core",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "0d79d19ab27c1962afc4ef802f386e160c4a555ca59bade20c901d7b8be99d0e"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT generate_invitation_code()",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "generate_invitation_code",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "0e518900101ca3ba736e18a911a07759368f0481b3c0dcd4702c077cdadb7ef0"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE export_jobs SET download_count = download_count + 1 WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "0ea2a972775b14b5a22edb7b7a81f414993d8153aebd7121acbcbd54257f32bf"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT p.name\n FROM plugins p\n JOIN community_plugins cp ON cp.plugin_id = p.id\n WHERE cp.community_id = $1 AND cp.is_active = true AND p.is_active = true",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "0ef338c61969938be731e6187b77c4d7454c409079ecc073aa24a10d339b47f1"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT COUNT(*) FROM notifications WHERE user_id = $1 AND is_read = false",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "count",
|
||||||
|
"type_info": "Int8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "10649f88f5a0055a0aa23cad37d0b51bd24c35ab290c412bad1286c0baaefd56"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT fp.id, fp.federation_id\n FROM federated_proposals fp\n WHERE fp.local_proposal_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "federation_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "10a632674ed7d086243d8a31abcb4935677106be2937daf876b01434fc07d293"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE compromise_proposals SET\n party_b_response = $2,\n party_b_response_at = NOW(),\n party_b_feedback = $3,\n updated_at = NOW()\n WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "117802a0a1de4ec2e5e3e7d2fd557421991b07876c7b42760bbe756b979d0e96"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO delegate_profiles (user_id, display_name, bio, accepting_delegations, delegation_policy)\n VALUES ($1, $2, $3, $4, $5)\n ON CONFLICT (user_id) DO UPDATE SET \n display_name = COALESCE($2, delegate_profiles.display_name),\n bio = COALESCE($3, delegate_profiles.bio),\n accepting_delegations = COALESCE($4, delegate_profiles.accepting_delegations),\n delegation_policy = COALESCE($5, delegate_profiles.delegation_policy),\n updated_at = NOW()\n RETURNING display_name, bio, accepting_delegations, delegation_policy, \n total_delegators, total_votes_cast",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "display_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "bio",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "accepting_delegations",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "delegation_policy",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "total_delegators",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "total_votes_cast",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Text",
|
||||||
|
"Bool",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "132ee5d7ab197b3a1d3bce2740f419e3cc2311e3cf0bbd0dfe821eebb4ca4fe0"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT COUNT(*) FROM community_members WHERE community_id = $1 AND role = 'admin'",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "count",
|
||||||
|
"type_info": "Int8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1414a9b0037bc888daa0b1215e88a78b20c7e2c614760f36307a248be45203ff"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n community_id,\n overall_health_score::float8 AS overall_health_score,\n participation_score::float8 AS participation_score,\n efficiency_score::float8 AS efficiency_score,\n delegation_health_score::float8 AS delegation_health_score,\n power_concentration_risk\n FROM governance_health_indicators\n WHERE community_id = $1\n ORDER BY calculated_at DESC\n LIMIT 1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "overall_health_score",
|
||||||
|
"type_info": "Float8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "participation_score",
|
||||||
|
"type_info": "Float8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "efficiency_score",
|
||||||
|
"type_info": "Float8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "delegation_health_score",
|
||||||
|
"type_info": "Float8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "power_concentration_risk",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "14514b4a260abf4b93429a3d841bea19693db589ad668279d7361f499fe7e408"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT COALESCE(\n (SELECT (cp.settings->>'auto_assign_mediators')::boolean\n FROM community_plugins cp\n JOIN plugins p ON p.id = cp.plugin_id\n WHERE cp.community_id = $1 AND p.name = 'conflict_resolution'),\n true\n ) AS \"auto_assign!\"",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "auto_assign!",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "150c49c9bd09af829b05abd06d6217aec3ed104f6286e2fc6bd741512cd254ff"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n COUNT(*) FILTER (WHERE reaction_type = 'agree') as agree,\n COUNT(*) FILTER (WHERE reaction_type = 'disagree') as disagree,\n COUNT(*) FILTER (WHERE reaction_type = 'insightful') as insightful,\n COUNT(*) FILTER (WHERE reaction_type = 'off_topic') as off_topic,\n COUNT(*) FILTER (WHERE reaction_type = 'constructive') as constructive\n FROM comment_reactions\n WHERE comment_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "agree",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "disagree",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "insightful",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "off_topic",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "constructive",
|
||||||
|
"type_info": "Int8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "155f20f35f5b4df59e1a53d0aa30f2994b0a6f76fcd1ff443a6bbe13e3d41339"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT community_id, status as \"status: crate::models::ProposalStatus\", voting_method FROM proposals WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "status: crate::models::ProposalStatus",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "proposal_status",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"draft",
|
||||||
|
"discussion",
|
||||||
|
"voting",
|
||||||
|
"closed",
|
||||||
|
"archived",
|
||||||
|
"calculating"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "voting_method",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1648eb605182a87a4fadd7158f7012dfe8011a56d63ea069a53bfd697bcdd166"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO mediation_notes (\n conflict_id, session_id, author_id, content, note_type, is_confidential\n ) VALUES ($1, $2, $3, $4, $5, $6)\n RETURNING id",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Text",
|
||||||
|
"Varchar",
|
||||||
|
"Bool"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "171bd1d2e58286b428275404fbaaaedab5d2ee9d3c0b76e3182b6fd48493cdc4"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n SELECT v.created_at as voted_at, po.label as option_label,\n p.id as proposal_id, p.title as proposal_title,\n c.name as community_name\n FROM votes v\n JOIN voting_identities vi ON v.voter_id = vi.id\n JOIN proposal_options po ON v.option_id = po.id\n JOIN proposals p ON po.proposal_id = p.id\n JOIN communities c ON p.community_id = c.id\n WHERE vi.user_id = $1\n ORDER BY v.created_at DESC\n LIMIT 20\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "voted_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "option_label",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "proposal_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "proposal_title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "community_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "174c2a9d861710b570536d1350b4e70b13a9290b222eb89ce753a5702de63f0a"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT approve_community($1, $2)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "approve_community",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "177d2a77cdaaa75e32bae953e520231ce713d5fb5f65f533660c773417be085a"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id, setup_completed, instance_name, platform_mode,\n registration_enabled, registration_mode,\n default_community_visibility, allow_private_communities,\n default_plugin_policy, default_moderation_mode\n FROM instance_settings LIMIT 1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "setup_completed",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "instance_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "platform_mode",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "registration_enabled",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "registration_mode",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "default_community_visibility",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "allow_private_communities",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "default_plugin_policy",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "default_moderation_mode",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "18c0fb05da45a3eea514f660bc4ac4d6aca71442645666a9c08db8f2a564ff6c"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT gi.id, gi.title, gi.description, gi.proposal_id\n FROM gitlab_issues gi\n JOIN gitlab_connections gc ON gi.connection_id = gc.id\n WHERE gi.id = $1 AND gc.community_id = $2",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "proposal_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "18f2bb2a5454308a0ca13ad574947eaa83e52ab32ba48687f54cdce41b34a141"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT i.*, c.name as community_name\n FROM invitations i\n LEFT JOIN communities c ON c.id = i.community_id\n WHERE i.code = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "code",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "created_by",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "email",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "max_uses",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "uses_count",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "expires_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "is_active",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 10,
|
||||||
|
"name": "community_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1ad83f237ca18e09dfac8f654b6befac12576bf30f35f3bf626b7ccf46a4fb94"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE voting_method_plugins SET\n is_active = COALESCE($2, is_active),\n is_default = COALESCE($3, is_default),\n updated_at = NOW()\n WHERE id = $1\n RETURNING id, name, display_name, description, icon, is_active, is_default,\n config_schema, default_config, complexity_level, supports_delegation",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "display_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "icon",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "is_active",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "is_default",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "config_schema",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "default_config",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "complexity_level",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 10,
|
||||||
|
"name": "supports_delegation",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Bool",
|
||||||
|
"Bool"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1cf0926848f8f1fc1f62337b344f06d86408f94450fe0ed80a44268657e92c06"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE rule_violations \n SET status = 'dismissed', \n reviewed_by = $2, \n reviewed_at = NOW(),\n review_notes = $3,\n resolved_at = NOW(),\n resolution_type = 'dismissed'\n WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "1dcd2fc713e43bb6e785befc420fe94db65d42df35bd8015c550c2f8666664e7"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id, community_id, gitlab_url, project_path, is_active,\n sync_issues, sync_merge_requests, auto_create_proposals, last_synced_at\n FROM gitlab_connections WHERE community_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "gitlab_url",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "project_path",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "is_active",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "sync_issues",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "sync_merge_requests",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "auto_create_proposals",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "last_synced_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1dedda4e97c32d56c88d29a247f788e5aac67cc9bc59fdd52b40926af3e5a671"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT * FROM users WHERE username = $1 AND is_active = true",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "username",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "email",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "password_hash",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "display_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "updated_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "is_active",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "is_admin",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "invited_by",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1efa9b54dff5200841ab35a40e525a8d0da40edca89aa78cd168ae3e854eabc2"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT author_id, status as \"status: crate::models::ProposalStatus\", title FROM proposals WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "author_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "status: crate::models::ProposalStatus",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "proposal_status",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"draft",
|
||||||
|
"discussion",
|
||||||
|
"voting",
|
||||||
|
"closed",
|
||||||
|
"archived",
|
||||||
|
"calculating"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "1fd0e024053913d7598c5cdb19f407cfa7fef149553e18efc9e5149dd77e7f1c"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "DELETE FROM comment_reactions WHERE comment_id = $1 AND user_id = $2 AND reaction_type = $3",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "20414e126202ce893b8e967c585ac6ee9c6cc869033bbe7bbf959d80dcedf82b"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT plugin_name, is_enabled, config FROM instance_plugins ORDER BY plugin_name",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "plugin_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "is_enabled",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "config",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "21412c1fff5f48e1ca0a5a67c49180efba50cdbc247a467474296f00a4f1f0f2"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT option_id, SUM(credits) as total_credits, COUNT(DISTINCT voter_id) as voter_count\n FROM quadratic_votes WHERE proposal_id = $1 GROUP BY option_id",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "option_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "total_credits",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "voter_count",
|
||||||
|
"type_info": "Int8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "222ef714ee6f0d715f09643cff679f1c9d5132051dea4cf1f809f06470ed9b44"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id, username, display_name, created_at FROM users WHERE username = $1 AND is_active = true",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "username",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "display_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "2376b5dff203895eb0b78454a323beb8a90d4ea20ca201226d4b228a2b846c4f"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,142 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n ml.id,\n ml.sequence_number,\n ml.community_id,\n ml.actor_user_id,\n u.username AS \"actor_username?\",\n ml.actor_role,\n ml.action_type::text AS \"action_type!\",\n ml.target_type,\n ml.target_id,\n ml.target_snapshot,\n ml.reason,\n ml.rule_reference,\n ml.evidence,\n ml.duration_hours,\n ml.expires_at,\n ml.decision_type,\n ml.vote_proposal_id,\n ml.vote_result,\n ml.previous_hash,\n ml.entry_hash,\n ml.created_at\n FROM moderation_ledger ml\n LEFT JOIN users u ON u.id = ml.actor_user_id\n WHERE ml.id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "sequence_number",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "actor_user_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "actor_username?",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "actor_role",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "action_type!",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "target_type",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "target_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "target_snapshot",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 10,
|
||||||
|
"name": "reason",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 11,
|
||||||
|
"name": "rule_reference",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 12,
|
||||||
|
"name": "evidence",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 13,
|
||||||
|
"name": "duration_hours",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 14,
|
||||||
|
"name": "expires_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 15,
|
||||||
|
"name": "decision_type",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 16,
|
||||||
|
"name": "vote_proposal_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 17,
|
||||||
|
"name": "vote_result",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 18,
|
||||||
|
"name": "previous_hash",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 19,
|
||||||
|
"name": "entry_hash",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 20,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "274cc3e62a3bc6659ae9e652d6ac15076f76a5fb7acad44f5e853678cfa2abf3"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n id, proposal_id, summary_type::text AS \"summary_type!\",\n content, version, is_approved\n FROM deliberation_summaries\n WHERE proposal_id = $1\n ORDER BY summary_type",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "proposal_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "summary_type!",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "content",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "version",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "is_approved",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "27723721585f30329494e2c80e4851b65cd980780e4b756019f73df0f9d28061"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n SELECT \n m.id, m.community_id, m.action_type, m.reason, m.details, m.created_at,\n mod_user.username as moderator_username,\n target_user.username as target_username\n FROM moderation_log m\n LEFT JOIN users mod_user ON m.moderator_id = mod_user.id\n LEFT JOIN users target_user ON m.target_user_id = target_user.id\n WHERE m.community_id = $1\n ORDER BY m.created_at DESC\n LIMIT 50\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "action_type",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "reason",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "details",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "moderator_username",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "target_username",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "28654edaba50887bd4c7f698e538ed9ec70543b1ba6d0ecc5b675a1040148b6a"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n UPDATE communities\n SET settings = settings || $2::jsonb,\n updated_at = NOW()\n WHERE id = $1 AND is_active = true\n RETURNING settings as \"settings!: serde_json::Value\"\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "settings!: serde_json::Value",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Jsonb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "2a13dcd10626c05bfed533ba131e46f2ba7c132c9e5d58afe30ba11179096bce"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n SELECT p.id, p.title, p.status as \"status: String\", p.created_at, c.slug as community_slug\n FROM proposals p\n JOIN communities c ON p.community_id = c.id\n WHERE c.is_active = true\n ORDER BY p.created_at DESC\n LIMIT 10\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "status: String",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "proposal_status",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"draft",
|
||||||
|
"discussion",
|
||||||
|
"voting",
|
||||||
|
"closed",
|
||||||
|
"archived",
|
||||||
|
"calculating"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "community_slug",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "2a288385b0b4f402803e22171965bedeeb6e40308d09f4a0d4f67258b11f7cd2"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO community_voting_methods (community_id, voting_method_id, is_enabled, is_default, config)\n VALUES ($1, $2, $3, $4, $5)\n ON CONFLICT (community_id, voting_method_id) DO UPDATE SET\n is_enabled = COALESCE($3, community_voting_methods.is_enabled),\n is_default = COALESCE($4, community_voting_methods.is_default),\n config = COALESCE($5, community_voting_methods.config),\n updated_at = NOW()\n RETURNING id, is_enabled, is_default, config",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "is_enabled",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "is_default",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "config",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Bool",
|
||||||
|
"Bool",
|
||||||
|
"Jsonb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "2a7e168921469392cdde35401ab602fdb281f995ad75050af27a4130c311a920"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT d.id, d.delegator_id, d.delegate_id, u.username as delegator_username,\n d.scope as \"scope: DelegationScope\", d.community_id, d.topic_id, \n d.proposal_id, d.is_active, d.created_at\n FROM delegations d\n JOIN users u ON d.delegator_id = u.id\n WHERE d.delegate_id = $1 AND d.is_active = TRUE\n ORDER BY d.created_at DESC",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "delegator_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "delegate_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "delegator_username",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "scope: DelegationScope",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "delegation_scope",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"global",
|
||||||
|
"community",
|
||||||
|
"topic",
|
||||||
|
"proposal"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "topic_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "proposal_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "is_active",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "2b38c2a93dda00a2ccd0ffe3d2cd83b9cf41d444b6f09b211a57dd6689a9e27e"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT COUNT(DISTINCT voter_id) FROM quadratic_votes WHERE proposal_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "count",
|
||||||
|
"type_info": "Int8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "2c9bb8a5dca54ef476b2908dfad34371f6f34e4a8500f855d01209d32840f683"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE deliberation_summaries SET\n content = $2, key_points = $3, last_editor_id = $4,\n version = version + 1, edit_count = edit_count + 1,\n is_approved = false, updated_at = NOW()\n WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Text",
|
||||||
|
"Jsonb",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "2ca4dcd48f294e84793ad46b960657a7d30cf790418baf4feab371fb45687627"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO public_events (community_id, actor_user_id, plugin_name, event_type, payload)\n VALUES ($1, $2, NULL, 'plugin.policy_updated', $3)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Jsonb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "2cb27026dc438da39c4132e9679d8312ed4909560135b5660c82e06ed61e6436"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "DELETE FROM comments WHERE proposal_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "2d6f151a2ed11e1a6efecfe1c1cd0242e3e28942cfbae4db71b4d9d709f96522"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n is_valid,\n total_entries,\n broken_at_sequence,\n expected_hash,\n actual_hash,\n error_message\n FROM verify_ledger_chain($1)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "is_valid",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "total_entries",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "broken_at_sequence",
|
||||||
|
"type_info": "Int8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "expected_hash",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "actual_hash",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "error_message",
|
||||||
|
"type_info": "Text"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "2f7f1f0d1960020529d167240c56abc5bcc6fcd5615890279d2bafcde467fe61"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE proposal_amendments SET\n status = 'accepted',\n reviewed_by = $2,\n reviewed_at = NOW(),\n review_response = $3\n WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "2f80cf2d27e9af290578740b2752a6a0d8c41e62aab523e16cc8cf123e59166f"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id FROM communities WHERE is_active = true",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "31639da003249b784d3603126cb36a1ea592bd819b8f43d9cbd192d7d405c44d"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT EXISTS(\n SELECT 1 FROM user_roles ur\n JOIN roles r ON r.id = ur.role_id\n WHERE ur.user_id = $1 AND r.name IN ('platform_admin', 'platform_moderator')\n ) AS \"exists!\"",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "exists!",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3167dfbfa487a695ad0953ed59b206fe16833cfe890fdae3fd74d6fe2d11ced5"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE export_jobs SET status = 'expired'\n WHERE status = 'completed' AND download_expires_at < NOW()\n RETURNING id",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3205e4cb752317923752ee9ace04a93ada7aa8cbfc97a87f9ddf6376dc102146"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n total_delegations,\n unique_delegators,\n unique_delegates,\n max_chain_depth,\n avg_chain_depth::float8 AS avg_chain_depth,\n top_10_delegate_share::float8 AS top_10_share,\n herfindahl_index::float8 AS hhi,\n effective_delegates\n FROM delegation_analytics\n WHERE community_id = $1\n ORDER BY snapshot_date DESC\n LIMIT 1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "total_delegations",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "unique_delegators",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "unique_delegates",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "max_chain_depth",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "avg_chain_depth",
|
||||||
|
"type_info": "Float8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "top_10_share",
|
||||||
|
"type_info": "Float8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "hhi",
|
||||||
|
"type_info": "Float8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "effective_delegates",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3271a11a6d1ad3cc05deda6d3e33bd350180c0b20da49b88c5bc04d5f06eb927"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO federated_proposals \n (federation_id, local_proposal_id, remote_proposal_id, is_origin_local)\n VALUES ($1, $2, $2, true)\n ON CONFLICT DO NOTHING",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "32e740982952a1d3756117f496bcff626f7bcb438a50fa8eef80e013a84e8048"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE delegations \n SET is_active = FALSE, revoked_at = NOW()\n WHERE delegator_id = $1 \n AND scope = $2::delegation_scope\n AND is_active = TRUE\n AND (community_id = $3 OR ($3 IS NULL AND community_id IS NULL))\n AND (topic_id = $4 OR ($4 IS NULL AND topic_id IS NULL))\n AND (proposal_id = $5 OR ($5 IS NULL AND proposal_id IS NULL))",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
{
|
||||||
|
"Custom": {
|
||||||
|
"name": "delegation_scope",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"global",
|
||||||
|
"community",
|
||||||
|
"topic",
|
||||||
|
"proposal"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3316c52a6ddc9891f4482e6f5df622147b1be87d0723bf709d6d7def94eb1a0c"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO public_events (community_id, actor_user_id, plugin_name, event_type, payload)\n VALUES ($1, $2, NULL, 'plugin.package_uploaded', $3)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Jsonb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "33281e190171ace099ef3209d49ac42b6527824947520336d7d11594ab56b265"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE rule_violations \n SET status = 'pending_vote', \n reviewed_by = $2, \n reviewed_at = NOW(),\n review_notes = $3,\n escalation_level = $4\n WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Text",
|
||||||
|
"Int4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "34ac1a3b360d0e99c80d59aad7497794803b0ca05cb498e7715344bc9d512084"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT user_has_permission($1, 'voting.methods.manage', $2)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "user_has_permission",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "35b2d2fb4f7db1ce97557c01de71c96e64862e3955e1e2d5996581eb4b871f3d"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO federation_sync_log (federation_id, operation_type, direction, success)\n VALUES ($1, 'local_approval', 'push', true)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3647ec42782a77237f075f172b4d435ac8d6325e60696018386ef1509e499a6d"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT community_id, rule_id, escalation_level FROM rule_violations WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "rule_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "escalation_level",
|
||||||
|
"type_info": "Int4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "39926d0308364c2a13c987adbc8b364253e9d8d350d69a1e1d3efd1c2e424d81"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,151 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT id, community_id, author_id, title, description,\n status as \"status: _\", voting_method, voting_starts_at, voting_ends_at,\n created_at, updated_at, deliberation_phase as \"deliberation_phase: _\",\n inform_starts_at, inform_ends_at, discuss_starts_at, discuss_ends_at,\n min_read_time_seconds, facilitator_id\n FROM proposals WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "author_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "description",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "status: _",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "proposal_status",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"draft",
|
||||||
|
"discussion",
|
||||||
|
"voting",
|
||||||
|
"closed",
|
||||||
|
"archived",
|
||||||
|
"calculating"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "voting_method",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "voting_starts_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "voting_ends_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 10,
|
||||||
|
"name": "updated_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 11,
|
||||||
|
"name": "deliberation_phase: _",
|
||||||
|
"type_info": {
|
||||||
|
"Custom": {
|
||||||
|
"name": "deliberation_phase",
|
||||||
|
"kind": {
|
||||||
|
"Enum": [
|
||||||
|
"drafting",
|
||||||
|
"informing",
|
||||||
|
"discussing",
|
||||||
|
"voting",
|
||||||
|
"concluded"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 12,
|
||||||
|
"name": "inform_starts_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 13,
|
||||||
|
"name": "inform_ends_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 14,
|
||||||
|
"name": "discuss_starts_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 15,
|
||||||
|
"name": "discuss_ends_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 16,
|
||||||
|
"name": "min_read_time_seconds",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 17,
|
||||||
|
"name": "facilitator_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3a395c6e9a23a87fbfa1b3d7a06fbe907b32e3cfb6af327cec1533b7762bd4cd"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n id, proposal_id, template_id, current_phase_id, \n status, started_at, completed_at\n FROM workflow_instances\n WHERE proposal_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "proposal_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "template_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "current_phase_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "status",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "started_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "completed_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3a8154bdd76daa157200feea1cce96d67bdb7b7c824088ca625105e96495938f"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT name FROM plugins WHERE is_active = true AND name = ANY($1)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"TextArray"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3b034411e6338ddaeae97589f0d0ab13cd674f852ad61b643a2e593d252767f1"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "DELETE FROM user_roles WHERE user_id = $1 AND role_id = $2 AND community_id = $3",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3c118e418b94a2d609cde609b53fbbb1a0055fe46397599f7c5eade17b0a5360"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO proposal_options (proposal_id, label, sort_order) VALUES ($1, $2, $3)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Int4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3c323153097726bf967b733fc7cb40173a1c64a4b7535a904445e5d02dbe2f0f"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT \n id, proposal_id, stance::text AS \"stance!\",\n title, content, author_id,\n upvotes, downvotes, quality_score::float8 AS quality_score\n FROM deliberation_arguments\n WHERE proposal_id = $1 AND stance::text = $2 AND NOT is_hidden AND parent_id IS NULL\n ORDER BY quality_score DESC NULLS LAST\n LIMIT $3",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "proposal_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "stance!",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "title",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "content",
|
||||||
|
"type_info": "Text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "author_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "upvotes",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "downvotes",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "quality_score",
|
||||||
|
"type_info": "Float8"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Text",
|
||||||
|
"Int8"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3c47d27c939cb21fbcc621825d1ef59d5284c3b6db07e2b11d772fefbcf1650b"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO proposal_resource_reads (resource_id, user_id)\n VALUES ($1, $2)\n ON CONFLICT (resource_id, user_id) DO NOTHING",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3c769ff42e6b6e2df033fa05cf6d8ae1e9fba6320943f65c95613f56a8ea2a13"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT name FROM communities WHERE id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3d523a0728ea6e9df275520675e3caab1963c61d5d6c3ad468cc51568d4bb5f8"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT platform_mode FROM instance_settings LIMIT 1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "platform_mode",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3d9153f242fa24637d71a4b4f0a76edee15892248acb6b281ffdbab11a4bff0f"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO public_events (community_id, actor_user_id, plugin_name, event_type, payload)\n VALUES ($1, $2, $3, 'plugin.settings_updated', $4)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Jsonb"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "3e0e0fe2c4e51b68025965560101643e7e035b782b1cd0d110803664c5831fe3"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT COALESCE(\n (SELECT vm.name FROM community_voting_methods cvm \n JOIN voting_method_plugins vm ON vm.id = cvm.voting_method_id\n WHERE cvm.community_id = $1 AND cvm.is_default = true\n LIMIT 1),\n (SELECT name FROM voting_method_plugins WHERE is_default = true LIMIT 1),\n 'approval'\n ) as \"method!\"",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "method!",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
null
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "3e7754fe4fe21c7fc50435ad222ed68617f8e8c4f2a21b202ee95d6f76ae0d32"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE delegate_profiles SET total_delegators = GREATEST(0, total_delegators - 1) WHERE user_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "403544e4819bc7bcc4ac51c997fb9ec74c3b3fa2c6f2b170ab5b8c8c1d9c65d4"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "UPDATE community_voting_methods SET is_default = FALSE WHERE community_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "41273682b6b15534294e7f90907c7a516cb658e276a50b44f72a2b739ee9e04b"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO invitations (code, created_by, email, community_id, max_uses, expires_at)\n VALUES ($1, $2, $3, $4, $5, $6)\n RETURNING id, code, created_by, email, community_id, max_uses, uses_count, \n expires_at, is_active, created_at",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "code",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "created_by",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 3,
|
||||||
|
"name": "email",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 4,
|
||||||
|
"name": "community_id",
|
||||||
|
"type_info": "Uuid"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 5,
|
||||||
|
"name": "max_uses",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 6,
|
||||||
|
"name": "uses_count",
|
||||||
|
"type_info": "Int4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 7,
|
||||||
|
"name": "expires_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 8,
|
||||||
|
"name": "is_active",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 9,
|
||||||
|
"name": "created_at",
|
||||||
|
"type_info": "Timestamptz"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Uuid",
|
||||||
|
"Varchar",
|
||||||
|
"Uuid",
|
||||||
|
"Int4",
|
||||||
|
"Timestamptz"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "42e0fab065d541e407129d44f86f1d1d46387494b992c81f7a334e72c42c98ca"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO conflict_history (conflict_id, action_type, action_description, actor_id)\n VALUES ($1, 'conflict_reported', 'Conflict case created', $2)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "43a864f79078c6891186f1d20600983ee080a7033137c0d715880cf20fc7776a"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO comment_reactions (comment_id, user_id, reaction_type) VALUES ($1, $2, $3)",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Uuid",
|
||||||
|
"Varchar"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "4619c7159d4bec14be35a308b0a867e3d5b0687a46a456adf6e8dcd1582d3849"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT plugin_name, is_core, default_enabled FROM default_plugins",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "plugin_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "is_core",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "default_enabled",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": []
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "47ea00355af927b41b9c39e55791042049a4bea2d1fab669b4ef6fee3f7a3497"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO instance_plugins (plugin_name, is_enabled, config, enabled_by, enabled_at)\n VALUES ($1, $2, $3, $4, NOW())\n ON CONFLICT (plugin_name) DO UPDATE SET\n is_enabled = COALESCE($2, instance_plugins.is_enabled),\n config = COALESCE($3, instance_plugins.config),\n updated_at = NOW()\n RETURNING plugin_name, is_enabled, config",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "plugin_name",
|
||||||
|
"type_info": "Varchar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 1,
|
||||||
|
"name": "is_enabled",
|
||||||
|
"type_info": "Bool"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordinal": 2,
|
||||||
|
"name": "config",
|
||||||
|
"type_info": "Jsonb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Varchar",
|
||||||
|
"Bool",
|
||||||
|
"Jsonb",
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "47ea0156899876339e02f4769e666c24d5d0fee1f18869d7adcb4aeb007076c8"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "SELECT accepting_delegations FROM delegate_profiles WHERE user_id = $1",
|
||||||
|
"describe": {
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"ordinal": 0,
|
||||||
|
"name": "accepting_delegations",
|
||||||
|
"type_info": "Bool"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": [
|
||||||
|
false
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"hash": "484e7ea64028000ccadd135f9806fd190f860d8ac1cd1c56828fa5be279f57c9"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "INSERT INTO role_permissions (role_id, permission_id, granted)\n SELECT $1, p.id, TRUE FROM permissions p WHERE p.name = $2\n ON CONFLICT (role_id, permission_id) DO UPDATE SET granted = TRUE",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Uuid",
|
||||||
|
"Text"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "4a92221917041b95e9a27e511ca70b404313e7dba1faf19bb1eb1347b2208587"
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue