2023-07-27 07:31:52 +02:00
|
|
|
/*
|
2024-02-13 16:59:27 +01:00
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-02-16 15:09:41 +01:00
|
|
|
import { Entity, Index, Column, PrimaryGeneratedColumn } from 'typeorm';
|
2023-09-20 04:33:36 +02:00
|
|
|
import { id } from './util/id.js';
|
2023-08-16 10:51:28 +02:00
|
|
|
import type { MiUser } from './User.js';
|
2022-07-02 08:12:11 +02:00
|
|
|
|
2023-08-16 10:51:28 +02:00
|
|
|
@Entity('user_ip')
|
2022-07-02 08:12:11 +02:00
|
|
|
@Index(['userId', 'ip'], { unique: true })
|
2023-08-16 10:51:28 +02:00
|
|
|
export class MiUserIp {
|
2022-07-02 08:12:11 +02:00
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
public id: string;
|
|
|
|
|
|
|
|
@Column('timestamp with time zone', {
|
|
|
|
})
|
|
|
|
public createdAt: Date;
|
|
|
|
|
|
|
|
@Index()
|
|
|
|
@Column(id())
|
2023-08-16 10:51:28 +02:00
|
|
|
public userId: MiUser['id'];
|
2022-07-02 08:12:11 +02:00
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128,
|
|
|
|
})
|
|
|
|
public ip: string;
|
|
|
|
}
|