mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 10:13:08 +02:00
63df2c851e
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
23 lines
453 B
TypeScript
23 lines
453 B
TypeScript
import { Entity, Index, Column, PrimaryGeneratedColumn } from 'typeorm';
|
|
import { id } from '../id.js';
|
|
import type { User } from './User.js';
|
|
|
|
@Entity()
|
|
@Index(['userId', 'ip'], { unique: true })
|
|
export class UserIp {
|
|
@PrimaryGeneratedColumn()
|
|
public id: string;
|
|
|
|
@Column('timestamp with time zone', {
|
|
})
|
|
public createdAt: Date;
|
|
|
|
@Index()
|
|
@Column(id())
|
|
public userId: User['id'];
|
|
|
|
@Column('varchar', {
|
|
length: 128,
|
|
})
|
|
public ip: string;
|
|
}
|