""", id,
)
- def create(self, distro, repo, name, user, stable=False):
+ def create(self, distro, name, user, stable=False):
"""
Creates a new release
"""
releases
(
distro_id,
- repo_id,
name,
slug,
created_by,
)
VALUES
(
- %s, %s, %s, %s, %s, %s
+ %s, %s, %s, %s, %s
)
RETURNING *
- """, distro, repo, name, slug, user, stable,
+ """, distro, name, slug, user, stable,
# Populate cache
- distro=distro, repo=repo,
+ distro=distro, created_by=user,
)
# XXX create image jobs
def distro(self):
return self.backend.distros.get_by_id(self.data.distro_id)
- # Repo
-
- @lazy_property
- def repo(self):
- return self.backend.repos.get_by_id(self.data.repo_id)
-
# Name
@property
CREATE TABLE public.releases (
id integer NOT NULL,
distro_id integer NOT NULL,
- repo_id integer NOT NULL,
name text NOT NULL,
slug text NOT NULL,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
ADD CONSTRAINT releases_distro_id FOREIGN KEY (distro_id) REFERENCES public.distributions(id);
---
--- Name: releases releases_repo_id; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY public.releases
- ADD CONSTRAINT releases_repo_id FOREIGN KEY (repo_id) REFERENCES public.repositories(id);
-
-
--
-- Name: repo_builds repo_builds_added_by; Type: FK CONSTRAINT; Schema: public; Owner: -
--