Swapnil-101 commited on
Commit
74de502
·
verified ·
1 Parent(s): f92b9c9

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -3
main.py CHANGED
@@ -11,25 +11,32 @@ from sqlalchemy.ext.declarative import declarative_base
11
 
12
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
13
 
14
- connection_string = "postgresql://neondb_owner:DsyRQ3YCe0BH@ep-spring-king-a1xyegni.ap-southeast-1.aws.neon.tech/neondb?sslmode=require"
15
 
16
  Base = declarative_base()
17
 
 
 
 
 
 
18
  class Mentor(Base):
19
  __tablename__ = 'mentors'
20
 
21
  id = Column(Integer, primary_key=True)
22
  mentor_name = Column(String)
23
- profile_photo = Column(LargeBinary) # Store mentor's profile photo as binary data
24
  description = Column(String)
25
  highest_degree = Column(String)
26
  expertise = Column(String)
27
  recent_project = Column(String)
28
  meeting_time = Column(String)
29
  fees = Column(String)
30
- stream = Column(String)
31
  country = Column(String)
32
  verified = Column(Boolean, default=False)
 
 
33
 
34
  engine = create_engine(connection_string)
35
  Session = sessionmaker(bind=engine)
 
11
 
12
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
13
 
14
+ connection_string = "postgresql://neondb_owner:Pl8cWUu0iLHn@ep-tiny-haze-a1w7wrrg.ap-southeast-1.aws.neon.tech/neondb?sslmode=require"
15
 
16
  Base = declarative_base()
17
 
18
+ class Stream(Base):
19
+ __tablename__ = 'streams'
20
+
21
+ name = Column(String, primary_key=True, nullable=False)
22
+
23
  class Mentor(Base):
24
  __tablename__ = 'mentors'
25
 
26
  id = Column(Integer, primary_key=True)
27
  mentor_name = Column(String)
28
+ profile_photo = Column(LargeBinary)
29
  description = Column(String)
30
  highest_degree = Column(String)
31
  expertise = Column(String)
32
  recent_project = Column(String)
33
  meeting_time = Column(String)
34
  fees = Column(String)
35
+ stream_name = Column(String, ForeignKey('streams.name'))
36
  country = Column(String)
37
  verified = Column(Boolean, default=False)
38
+
39
+ stream = relationship("Stream", backref="mentors")
40
 
41
  engine = create_engine(connection_string)
42
  Session = sessionmaker(bind=engine)