.select(Distro)
.where(
Distro.deleted_at == None,
- Distro.distro_id + Distro.version_id == tag,
+ Distro.tag == tag,
)
)
# Tag
- #@property
- #def tag(self):
- # return "%s%s" % (self.distro_id, self.version_id)
-
- #tag = Column(Text, Computed(distro_id + version_id), unique=True, nullable=False)
+ tag = Column(Text, Computed(distro_id + version_id), unique=True)
# Pakfire
codename text DEFAULT ''::text NOT NULL,
bugzilla_product text DEFAULT ''::text NOT NULL,
bugzilla_version text DEFAULT ''::text NOT NULL,
- deleted_at timestamp without time zone
+ deleted_at timestamp without time zone,
+ tag text GENERATED ALWAYS AS ((distro_id || version_id)) STORED
);
CREATE UNIQUE INDEX builds_uuid ON public.builds USING btree (uuid) WHERE (deleted_at IS NULL);
+--
+-- Name: distributions_tag; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE UNIQUE INDEX distributions_tag ON public.distributions USING btree (tag) WHERE (deleted_at IS NULL);
+
+
--
-- Name: distributions_unique; Type: INDEX; Schema: public; Owner: -
--