From c535a842feb3dd406fbed052d483656071fbc15d Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Mon, 25 Mar 2024 10:42:34 +0530 Subject: [PATCH] Drop tags table --- .../rss/reader/core/model/local/Tag.kt | 27 ------------------ .../sasikanth/rss/reader/di/DataComponent.kt | 10 ------- .../src/commonMain/sqldelight/databases/12.db | Bin 0 -> 86016 bytes .../dev/sasikanth/rss/reader/database/Tag.sq | 26 ----------------- .../commonMain/sqldelight/migrations/11.sqm | 1 + 5 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 core/model/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/model/local/Tag.kt create mode 100644 shared/src/commonMain/sqldelight/databases/12.db delete mode 100644 shared/src/commonMain/sqldelight/dev/sasikanth/rss/reader/database/Tag.sq create mode 100644 shared/src/commonMain/sqldelight/migrations/11.sqm diff --git a/core/model/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/model/local/Tag.kt b/core/model/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/model/local/Tag.kt deleted file mode 100644 index e50005a0f..000000000 --- a/core/model/src/commonMain/kotlin/dev/sasikanth/rss/reader/core/model/local/Tag.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2024 Sasikanth Miriyampalli - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.sasikanth.rss.reader.core.model.local - -import com.benasher44.uuid.Uuid -import kotlinx.datetime.Instant - -data class Tag( - val id: Uuid, - val label: String, - val createdAt: Instant, - val updatedAt: Instant, -) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/DataComponent.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/DataComponent.kt index fdeee3415..39afd5746 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/DataComponent.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/di/DataComponent.kt @@ -21,8 +21,6 @@ import dev.sasikanth.rss.reader.database.DateAdapter import dev.sasikanth.rss.reader.database.Feed import dev.sasikanth.rss.reader.database.Post import dev.sasikanth.rss.reader.database.ReaderDatabase -import dev.sasikanth.rss.reader.database.Tag -import dev.sasikanth.rss.reader.database.UuidAdapter import dev.sasikanth.rss.reader.di.scopes.AppScope import me.tatarka.inject.annotations.Provides @@ -45,12 +43,6 @@ internal interface DataComponent : SqlDriverPlatformComponent, DataStorePlatform lastCleanUpAtAdapter = DateAdapter ), bookmarkAdapter = Bookmark.Adapter(dateAdapter = DateAdapter), - tagAdapter = - Tag.Adapter( - idAdapter = UuidAdapter, - createdAtAdapter = DateAdapter, - updatedAtAdapter = DateAdapter - ) ) } @@ -65,6 +57,4 @@ internal interface DataComponent : SqlDriverPlatformComponent, DataStorePlatform @Provides fun providesFeedSearchFTSQueries(database: ReaderDatabase) = database.feedSearchFTSQueries - - @Provides fun providesTagQueries(database: ReaderDatabase) = database.tagQueries } diff --git a/shared/src/commonMain/sqldelight/databases/12.db b/shared/src/commonMain/sqldelight/databases/12.db new file mode 100644 index 0000000000000000000000000000000000000000..e93f6c663ec44565ff1e65f794a641e4bdd0c26d GIT binary patch literal 86016 zcmeI5O>Y~=8OKSB;!?D1*>PAlQ4I`iq#|uvwrU6|U!jyLB{rNrr zd1j~`OXa^5nvTt$cKdD1VYdSp0>NP5eZ~R-ei;bF_*=c+<`*G#!@mc$>uHx40;~PM z&r{*0S5)Tw(yQ~=&Sn?CSvZJ%Y1}me;qv_Fp|3-Gb6=hLHuyuZ9}FygKdrG}BfWRY zh~Kyo9A0v)CoTJ_Z8vHI+v?Y!)f$##P2NW{B{N+yStY$$Fxkpv_DZ7JVEJOj+%ik- zekp%1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rh?MWsFcT#QkaxX28e+7A~bKrW3k}NU9qDh#nC&g78tQTXNSs%Fec|~nlJvjbhS`nx2Sg= zscceZD{Dk7QX644K5rv^>mVaT%e+G$k|T)S-HF4uiNRq)2z4rk{Y{=;|S~UEh>y?*dHnsqU*^XdXaxj700ck)1V8`;KmY_l00ck)1b)i|==1-Zq5lMy zzF3N!H_!d`+#eU8pZ#0(AJLVCFBVoK|BSq6d}FMIzYPC*{$KMZFNhZifB*>mRtfYk z8}YTZ;Baa5EJmGa;Xjpq+T0P(0o;Q|G9~8uf%J;Mz)E7*^Q?q@G;xUNqdyq&+qcyr zBE5k|w?5$KZjMNLb9%3CrRk@M2A{~IM9-IHzi%C7D?N4A`{l+`(xvJBx+SLfTffC0 z?yd3npOVAS+xqb>y(4~nYvT5e>3#CTKkN9`Tl(=Wy<0kuHFu8Gn%?V)mA@a8{azGK&^vKOd_>Z@>HVHi`CRolv^a5EQv-dZ>a~2I>cxZj zAEj{|TGWoR$um3@R+O@59?hI`2#o5xhgf`vg7lDuLyI`H$j{Tr!!zp4O;Vot!=XiS zHbw0;>9pzp$)QC&|NpIikiob>00ck)1V8`;KmY_l00ck)1VG@IBS63ZFSztwfd9h_ z1V8`;KmY_l00ck)1V8`;KmY_l;1m%!JGUJC$nFpLFIEfT@Bf`5$HEj4009sH0T2KI z5C8!X009sH0T7S`@b~|q1P}lL5C8!X009sH0T2KI5C8!Xcnt~Q|Np;+PKU`L00JNY z0w4eaAOHd&00JNY0Xl00ck)1V8`;KmY_l00ck)1YSb|`2Bycq0?b9 d2!H?xfB*=900@8p2!H?xfWT`(K>z)J{{yi+fmQ$j literal 0 HcmV?d00001 diff --git a/shared/src/commonMain/sqldelight/dev/sasikanth/rss/reader/database/Tag.sq b/shared/src/commonMain/sqldelight/dev/sasikanth/rss/reader/database/Tag.sq deleted file mode 100644 index 1be743841..000000000 --- a/shared/src/commonMain/sqldelight/dev/sasikanth/rss/reader/database/Tag.sq +++ /dev/null @@ -1,26 +0,0 @@ -import com.benasher44.uuid.Uuid; -import kotlinx.datetime.Instant; - -CREATE TABLE tag ( - id TEXT AS Uuid NOT NULL PRIMARY KEY, - label TEXT NOT NULL, - createdAt INTEGER AS Instant NOT NULL, - updatedAt INTEGER AS Instant NOT NULL -); - -countTags: -SELECT COUNT(*) FROM tag; - -tags: -SELECT * FROM tag -LIMIT :limit OFFSET :offset; - -updateTag: -UPDATE tag SET label = :label WHERE id = :id; - -deleteTag: -DELETE FROM tag WHERE id = :id; - -saveTag: -INSERT OR IGNORE INTO tag(id, label, createdAt, updatedAt) -VALUES (:id, :label, :createdAt, :updatedAt); diff --git a/shared/src/commonMain/sqldelight/migrations/11.sqm b/shared/src/commonMain/sqldelight/migrations/11.sqm new file mode 100644 index 000000000..8e3d418e6 --- /dev/null +++ b/shared/src/commonMain/sqldelight/migrations/11.sqm @@ -0,0 +1 @@ +DROP TABLE IF EXISTS tag;