Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename LetterSoundCorrespondence to LetterSound #1677

Closed
6 tasks done
nya-elimu opened this issue Jul 5, 2024 · 4 comments · Fixed by #1725
Closed
6 tasks done

Rename LetterSoundCorrespondence to LetterSound #1677

nya-elimu opened this issue Jul 5, 2024 · 4 comments · Fixed by #1725
Assignees
Labels
good first issue Good for newcomers

Comments

@nya-elimu
Copy link
Member

nya-elimu commented Jul 5, 2024

Rename the LetterSoundCorrespondence entity.

From LetterSoundCorrespondence.java to LetterSound.java.

@nya-elimu nya-elimu added the good first issue Good for newcomers label Jul 5, 2024
@SnehaHS65
Copy link
Contributor

Hi, can I take up this issue?

@nya-elimu
Copy link
Member Author

Hi, can I take up this issue?

@SnehaHS65 Yes, please do 🙂

SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 6, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 6, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 7, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 7, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 7, 2024
jo-elimu added a commit that referenced this issue Jul 12, 2024
Rename Word's property `letterSoundCorrespondences` to `letterSounds`.

refs #1677
jo-elimu added a commit that referenced this issue Jul 12, 2024
Should be `DROP FOREIGN KEY`

refs #1677
jo-elimu added a commit that referenced this issue Jul 12, 2024
jo-elimu added a commit that referenced this issue Jul 13, 2024
jo-elimu added a commit that referenced this issue Jul 13, 2024
jo-elimu added a commit that referenced this issue Jul 13, 2024
@SnehaHS65 SnehaHS65 assigned SnehaHS65 and unassigned SnehaHS65 Jul 13, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 13, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 13, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 13, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 13, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 13, 2024
SnehaHS65 pushed a commit to SnehaHS65/webapp that referenced this issue Jul 14, 2024
jo-elimu added a commit to SnehaHS65/webapp that referenced this issue Jul 24, 2024
jo-elimu added a commit to SnehaHS65/webapp that referenced this issue Jul 24, 2024
jo-elimu added a commit that referenced this issue Jul 25, 2024
@jo-elimu
Copy link
Member

@SnehaHS65 After running the DB migration script, I just realized that

ALTER TABLE `LetterSound_Letter` DROP COLUMN `LetterSound_id`;

and

ALTER TABLE `LetterSound_Sound` DROP COLUMN `LetterSound_id`;

will not work because they don't exist. These columns do get created automatically, but only in the new empty tables LetterSound_Letter and LetterSound_Sound. And since we delete those empty tables before renaming the original tables, we can remove these DROP COLUMN commands from the file: https://github.com/elimu-ai/webapp/pull/1777/files

@jo-elimu
Copy link
Member

Done:

[HIN] 05:53:05.488 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Migration script found for version 2004022
[HIN] 05:53:05.488 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: DROP TABLE IF EXISTS `LetterSound`;
[HIN] 05:53:05.499 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: ALTER TABLE `LetterSoundCorrespondence` RENAME TO `LetterSound`;
[HIN] 05:53:05.503 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: DROP TABLE IF EXISTS `LetterSound_Letter`;
[HIN] 05:53:05.505 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: ALTER TABLE `LetterSoundCorrespondence_Letter` RENAME TO `LetterSound_Letter`;
[HIN] 05:53:05.509 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: ALTER TABLE `LetterSound_Letter` CHANGE `LetterSoundCorrespondence_id` `LetterSound_id` bigint(20) NOT NULL;
[HIN] 05:53:05.515 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: DROP TABLE IF EXISTS `LetterSound_Sound`;
[HIN] 05:53:05.519 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: ALTER TABLE `LetterSoundCorrespondence_Sound` RENAME TO `LetterSound_Sound`;
[HIN] 05:53:05.524 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: ALTER TABLE `LetterSound_Sound` CHANGE `LetterSoundCorrespondence_id` `LetterSound_id` bigint(20) NOT NULL;
[HIN] 05:53:05.536 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: DROP TABLE IF EXISTS `Word_LetterSound`;
[HIN] 05:53:05.541 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Executing sql: ALTER TABLE `Word_LetterSoundCorrespondence` RENAME TO `Word_LetterSound`;
[HIN] 05:53:05.545 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Updating current version (2004022)
[HIN] 05:53:05.550 [main] INFO  ai.elimu.util.db.DbMigrationHelper - Database migration complete!

@SnehaHS65 Your changes are now in production (http://hin.elimu.ai/ + http://tgl.elimu.ai/), and from what I can see everything is running smoothly. Thank you very much for putting so much time and effort into this change, which I think helped make the code more simple and easier to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants