Files
twenty/packages/twenty-website/src/database/schema-postgres.ts
Ady Beraud df5cb9a904 Smart changelog (#5205)
Added a smart Changelog :

- Publish the Changelog before the app release. If the release has not
yet been pushed to production, do not display it.
- When the app release is done, make the Changelog available with the
correct date.
- If the Changelog writing is delayed because the release has already
been made, publish it immediately.
- Display everything locally to be able to iterate on the changelog and
have a preview

Added an endpoint for the Changelog

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-05-01 08:35:11 +02:00

63 lines
1.8 KiB
TypeScript

import { date, integer, pgTable, text, timestamp } from 'drizzle-orm/pg-core';
export const pgUsers = pgTable('users', {
id: text('id').primaryKey(),
avatarUrl: text('avatarUrl'),
url: text('url'),
isEmployee: text('isEmployee'),
});
export const pgPullRequests = pgTable('pullRequests', {
id: text('id').primaryKey(),
title: text('title'),
body: text('body'),
url: text('url'),
createdAt: text('createdAt'),
updatedAt: text('updatedAt'),
closedAt: text('closedAt'),
mergedAt: text('mergedAt'),
authorId: text('authorId').references(() => pgUsers.id),
});
export const pgIssues = pgTable('issues', {
id: text('id').primaryKey(),
externalId: text('externalId'),
title: text('title'),
body: text('body'),
url: text('url'),
createdAt: text('createdAt'),
updatedAt: text('updatedAt'),
closedAt: text('closedAt'),
authorId: text('authorId').references(() => pgUsers.id),
});
export const pgLabels = pgTable('labels', {
id: text('id').primaryKey(),
externalId: text('externalId'),
name: text('name'),
color: text('color'),
description: text('description'),
});
export const pgPullRequestLabels = pgTable('pullRequestLabels', {
pullRequestId: text('pullRequestExternalId').references(
() => pgPullRequests.id,
),
labelId: text('labelId').references(() => pgLabels.id),
});
export const pgIssueLabels = pgTable('issueLabels', {
issueId: text('issueId').references(() => pgIssues.id),
labelId: text('labelId').references(() => pgLabels.id),
});
export const pgGithubStars = pgTable('githubStars', {
timestamp: timestamp('timestamp').notNull().defaultNow(),
numberOfStars: integer('numberOfStars'),
});
export const pgGithubReleasesModel = pgTable('githubReleases', {
tagName: text('tagName').primaryKey(),
publishedAt: date('publishedAt', { mode: 'string' }).notNull(),
});