Inital commit

This commit is contained in:
Terncode committed 2026-11-24 22:05:11 +01:00
commit a6af7dbfcb
114 files changed
+27520

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
ManyToOne,
OneToMany,
} from "typeorm";
@Entity()
export class IP {
@PrimaryGeneratedColumn()
id!: number;
@Column()
ip!: string;
@Column({ nullable: true })
data?: string;
@Column()
lastUsed!: Date;
@Column()
firstSeen!: Date;
@Column({ nullable: true })
lat!: number;
@Column({ nullable: true })
lon?: number;
@OneToMany(() => IpLog, (log) => log.ipRef)
logs!: IpLog[];
}
@Entity()
export class IpLog {
@PrimaryGeneratedColumn()
id!: number;
@Column({ nullable: true })
url?: string;
@Column({ nullable: true })
userAgent?: string;
@Column()
accessed!: Date;
@ManyToOne(() => IP, (ip) => ip.logs, { eager: true })
ipRef!: IP;
}