-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add planet texture images in webp format (#50)
* feat: add `imageUrl` property to `Planet` model * refractor: make environment variable more reusable * feat: populate `imageUrl` property * fix: resolve issues with invalid url
- Loading branch information
1 parent
02002dd
commit 919397f
Showing
7 changed files
with
77 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `imageUrl` to the `Planet` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- RedefineTables | ||
PRAGMA foreign_keys=OFF; | ||
CREATE TABLE "new_Planet" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"index" BIGINT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"ownerId" INTEGER NOT NULL, | ||
"sectorId" INTEGER NOT NULL, | ||
"health" INTEGER NOT NULL, | ||
"maxHealth" INTEGER NOT NULL, | ||
"imageUrl" TEXT NOT NULL, | ||
"players" INTEGER NOT NULL, | ||
"disabled" BOOLEAN NOT NULL, | ||
"regeneration" INTEGER NOT NULL, | ||
"liberation" REAL NOT NULL, | ||
"liberationRate" REAL NOT NULL, | ||
"liberationState" TEXT NOT NULL, | ||
"initialOwnerId" INTEGER NOT NULL, | ||
"positionX" REAL NOT NULL, | ||
"positionY" REAL NOT NULL, | ||
"globalEventId" INTEGER, | ||
"biomeId" INTEGER NOT NULL, | ||
"statisticId" INTEGER, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" DATETIME NOT NULL, | ||
CONSTRAINT "Planet_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "Faction" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, | ||
CONSTRAINT "Planet_sectorId_fkey" FOREIGN KEY ("sectorId") REFERENCES "Sector" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, | ||
CONSTRAINT "Planet_initialOwnerId_fkey" FOREIGN KEY ("initialOwnerId") REFERENCES "Faction" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, | ||
CONSTRAINT "Planet_globalEventId_fkey" FOREIGN KEY ("globalEventId") REFERENCES "GlobalEvent" ("id") ON DELETE SET NULL ON UPDATE CASCADE, | ||
CONSTRAINT "Planet_biomeId_fkey" FOREIGN KEY ("biomeId") REFERENCES "Biome" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, | ||
CONSTRAINT "Planet_statisticId_fkey" FOREIGN KEY ("statisticId") REFERENCES "Stats" ("id") ON DELETE SET NULL ON UPDATE CASCADE | ||
); | ||
INSERT INTO "new_Planet" ("biomeId", "createdAt", "disabled", "globalEventId", "health", "id", "index", "initialOwnerId", "liberation", "liberationRate", "liberationState", "maxHealth", "name", "ownerId", "players", "positionX", "positionY", "regeneration", "sectorId", "statisticId", "updatedAt") SELECT "biomeId", "createdAt", "disabled", "globalEventId", "health", "id", "index", "initialOwnerId", "liberation", "liberationRate", "liberationState", "maxHealth", "name", "ownerId", "players", "positionX", "positionY", "regeneration", "sectorId", "statisticId", "updatedAt" FROM "Planet"; | ||
DROP TABLE "Planet"; | ||
ALTER TABLE "new_Planet" RENAME TO "Planet"; | ||
CREATE UNIQUE INDEX "Planet_index_key" ON "Planet"("index"); | ||
CREATE UNIQUE INDEX "Planet_statisticId_key" ON "Planet"("statisticId"); | ||
PRAGMA foreign_key_check; | ||
PRAGMA foreign_keys=ON; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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