mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
50 lines
920 B
TypeScript
50 lines
920 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
ManyToMany,
|
|
ManyToOne,
|
|
PrimaryGeneratedColumn,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
import { User } from '../users/user.entity';
|
|
import { Revision } from './revision.entity';
|
|
|
|
/**
|
|
* This class stores which parts of a revision were edited by a particular user.
|
|
*/
|
|
@Entity()
|
|
export class Authorship {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
/**
|
|
* Revisions this authorship appears in
|
|
*/
|
|
@ManyToMany((_) => Revision, (revision) => revision.authorships)
|
|
revisions: Revision[];
|
|
|
|
/**
|
|
* User this authorship represents
|
|
*/
|
|
@ManyToOne((_) => User)
|
|
user: User;
|
|
|
|
@Column()
|
|
startPos: number;
|
|
|
|
@Column()
|
|
endPos: number;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn()
|
|
updatedAt: Date;
|
|
}
|