mirror of
https://github.com/outline/outline.git
synced 2026-11-25 07:04:37 +03:00
stash
This commit is contained in:
2 files changed
+35
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
/** @type {import('sequelize-cli').Migration} */
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
await queryInterface.addColumn("teams", "retentionFilter", {
|
||||
type: Sequelize.JSONB,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
});
|
||||
|
||||
await queryInterface.addColumn("collections", "retentionFilter", {
|
||||
type: Sequelize.JSONB,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
});
|
||||
},
|
||||
|
||||
async down(queryInterface, Sequelize) {
|
||||
await queryInterface.removeColumn("collections", "retentionFilter");
|
||||
await queryInterface.removeColumn("teams", "retentionFilter");
|
||||
},
|
||||
};
|
||||
@@ -51,6 +51,14 @@ import IsUrlOrRelativePath from "./validators/IsUrlOrRelativePath";
|
||||
import Length from "./validators/Length";
|
||||
import NotContainsUrl from "./validators/NotContainsUrl";
|
||||
import { SkipChangeset } from "./decorators/Changeset";
|
||||
import { builderFilterSchema } from "@shared/helpers/FilterHelper";
|
||||
import z from "zod";
|
||||
|
||||
const { FilterSchema: RetentionFilterSchema } = builderFilterSchema(
|
||||
z.enum(["createdAt", "updatedAt"])
|
||||
);
|
||||
|
||||
type RetentionFilter = z.infer<typeof RetentionFilterSchema>;
|
||||
|
||||
@Scopes(() => ({
|
||||
withDomains: {
|
||||
@@ -195,6 +203,10 @@ class Team extends ParanoidModel<
|
||||
@SkipChangeset
|
||||
previousSubdomains: string[] | null;
|
||||
|
||||
@AllowNull
|
||||
@Column(DataType.JSONB)
|
||||
retentionFilter: RetentionFilter | null;
|
||||
|
||||
// getters
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user