Closed twocs closed 1 month ago
Someone is attempting to deploy a commit to the formulosity Team on Vercel.
A member of the Team first needs to authorize it.
Thanks for working on this @twocs However I already replied in he ticket that we don't need it.
I guess we don't need formality either, because it doesn't support our database.
https://github.com/plutov/formulosity/issues/29
For a hacktoberfest contribution, I have implemented mysql storage. It was a bit tricky to work past mysql limitations, but now all the tests are passing. This pull request introduces support for MySQL alongside existing support for PostgreSQL and SQLite. The changes span configuration updates, new database migrations, and modifications to the service initialization logic.
Database Support Expansion:
README.md
: UpdatedDATABASE_TYPE
to includemysql
and revised the description forDATABASE_URL
to include MySQL connection strings.api/go.mod
: Addedgithub.com/go-sql-driver/mysql
andfilippo.io/edwards25519
as indirect dependencies.MySQL Migrations:
api/migrations/mysql/000001_schema.up.sql
: Createdsurveys
table with columns for survey metadata.api/migrations/mysql/000002_schema.up.sql
: Createdsurveys_sessions
table with columns for session data and a foreign key reference tosurveys
.api/migrations/mysql/000003_schema.up.sql
: Createdsurveys_questions
table with columns for question data and a foreign key reference tosurveys
.api/migrations/mysql/000004_schema.up.sql
: Added a unique index onsurveys_questions
forsurvey_id
andquestion_id
.api/migrations/mysql/000005_schema.up.sql
: Createdsurveys_answers
table with columns for answer data and foreign key references tosurveys_sessions
andsurveys_questions
.api/migrations/mysql/000006_schema.up.sql
: Added a unique index onsurveys_answers
forsession_id
andquestion_id
.Service Initialization:
api/pkg/services/services.go
: Added support for initializing a MySQL storage backend based on theDATABASE_TYPE
environment variable.Docker Configuration:
compose.yaml
: Updated theapi
service to depend on MySQL and added configuration for a MySQL service with health checks and volume mappings. [1] [2]Some known issues: