diff --git a/src/main/resources/db/migration/V2__enforce_validation_lengths.sql b/src/main/resources/db/migration/V2__enforce_validation_lengths.sql new file mode 100644 index 0000000..58b900a --- /dev/null +++ b/src/main/resources/db/migration/V2__enforce_validation_lengths.sql @@ -0,0 +1,16 @@ +/* + * V2__enforce_validation_lengths.sql + * + * Aligns persisted column lengths with the Phase 6 API validation contract. + * Flyway applies this after the initial schema so existing local databases can + * migrate forward without rewriting the original migration checksum. + */ + +ALTER TABLE users + ALTER COLUMN username TYPE VARCHAR(50); + +ALTER TABLE notes + ALTER COLUMN title TYPE VARCHAR(200); + +ALTER TABLE notes + ALTER COLUMN content TYPE VARCHAR(10000);