Update database configuration to use biveki database with prism_ table prefix
This commit is contained in:
@ -16,11 +16,14 @@ cp .env.example .env
|
|||||||
```env
|
```env
|
||||||
DATABASE_HOST=85.234.110.60
|
DATABASE_HOST=85.234.110.60
|
||||||
DATABASE_PORT=5432
|
DATABASE_PORT=5432
|
||||||
DATABASE_USERNAME=prism
|
DATABASE_USERNAME=bivekich
|
||||||
DATABASE_PASSWORD=oaZ3-4Y6yf
|
DATABASE_PASSWORD=1kZoaf4_bQ
|
||||||
DATABASE_NAME=prism
|
DATABASE_NAME=biveki
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Важно**: База данных используется совместно с другими проектами.
|
||||||
|
Все таблицы Prism Messenger имеют префикс `prism_` для избежания конфликтов.
|
||||||
|
|
||||||
### Проверка подключения
|
### Проверка подключения
|
||||||
|
|
||||||
Если возникают проблемы с подключением:
|
Если возникают проблемы с подключением:
|
||||||
@ -35,7 +38,7 @@ DATABASE_NAME=prism
|
|||||||
|
|
||||||
3. **Тестирование подключения через psql**:
|
3. **Тестирование подключения через psql**:
|
||||||
```bash
|
```bash
|
||||||
psql 'postgresql://prism:oaZ3-4Y6yf@85.234.110.60:5432/prism'
|
psql 'postgresql://bivekich:1kZoaf4_bQ@85.234.110.60:5432/biveki'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Альтернативная локальная разработка
|
### Альтернативная локальная разработка
|
||||||
|
@ -4,7 +4,7 @@ import { User } from '../../users/entities/user.entity';
|
|||||||
import { Message } from '../../messages/entities/message.entity';
|
import { Message } from '../../messages/entities/message.entity';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
@Entity('conversations')
|
@Entity('prism_conversations')
|
||||||
export class Conversation {
|
export class Conversation {
|
||||||
@Field(() => ID)
|
@Field(() => ID)
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn('uuid')
|
||||||
@ -21,7 +21,7 @@ export class Conversation {
|
|||||||
@Field(() => [User])
|
@Field(() => [User])
|
||||||
@ManyToMany(() => User)
|
@ManyToMany(() => User)
|
||||||
@JoinTable({
|
@JoinTable({
|
||||||
name: 'conversation_participants',
|
name: 'prism_conversation_participants',
|
||||||
joinColumn: { name: 'conversationId', referencedColumnName: 'id' },
|
joinColumn: { name: 'conversationId', referencedColumnName: 'id' },
|
||||||
inverseJoinColumn: { name: 'userId', referencedColumnName: 'id' },
|
inverseJoinColumn: { name: 'userId', referencedColumnName: 'id' },
|
||||||
})
|
})
|
||||||
|
@ -4,7 +4,7 @@ import { User } from '../../users/entities/user.entity';
|
|||||||
import { Conversation } from '../../conversations/entities/conversation.entity';
|
import { Conversation } from '../../conversations/entities/conversation.entity';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
@Entity('messages')
|
@Entity('prism_messages')
|
||||||
export class Message {
|
export class Message {
|
||||||
@Field(() => ID)
|
@Field(() => ID)
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
@ -3,7 +3,7 @@ import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateCol
|
|||||||
import { Message } from '../../messages/entities/message.entity';
|
import { Message } from '../../messages/entities/message.entity';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
@Entity('users')
|
@Entity('prism_users')
|
||||||
export class User {
|
export class User {
|
||||||
@Field(() => ID)
|
@Field(() => ID)
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
Reference in New Issue
Block a user