2023-07-27 14:31:52 +09:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-02-16 23:09:41 +09:00
|
|
|
import { Entity, Index, Column, PrimaryGeneratedColumn } from 'typeorm';
|
2022-07-02 15:12:11 +09:00
|
|
|
import { id } from '../id.js';
|
2022-09-18 03:27:08 +09:00
|
|
|
import type { User } from './User.js';
|
2022-07-02 15:12:11 +09:00
|
|
|
|
|
|
|
@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;
|
|
|
|
}
|