Created
July 16, 2019 14:23
-
-
Save dinorahto/150455745b917f68c56300c24fe616b8 to your computer and use it in GitHub Desktop.
ForeignKeys on Room migration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val queryForDatabase = """ | |
| CREATE TABLE IF NOT EXISTS UpdatedTableProduct (idProduct TEXT PRIMARY KEY NOT NULL, name TEXT, nameClean TEXT, | |
| description TEXT, discount INT, skuId TEXT, hasAddedToCart INT, opened INT, notified INT, | |
| FOREIGN KEY (idProduct) REFERENCES Image(imageId) ON UPDATE NO ACTION ON DELETE NO ACTION, | |
| FOREIGN KEY (skuId) REFERENCES Prices(idProduct) ON UPDATE NO ACTION ON DELETE NO ACTION """" | |
| database.execSQL(queryForDatabase) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment