now creating dewars, pucks and samples from spreadsheet and replacing dewars if a dewar with the same name exists

This commit is contained in:
GotthardG
2024-11-12 17:03:38 +01:00
parent 86883133a7
commit 8f7c90bab0
5 changed files with 327 additions and 134 deletions

View File

@ -1,4 +1,4 @@
from sqlalchemy import Column, Integer, String, Date, ForeignKey
from sqlalchemy import Column, Integer, String, Date, ForeignKey, JSON
from sqlalchemy.orm import relationship
from app.database import Base
from app.calculations import calculate_number_of_pucks, calculate_number_of_samples
@ -107,6 +107,7 @@ class Sample(Base):
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
sample_name = Column(String, index=True) # Matches `sample_name` in data creation
position = Column(Integer) # Matches `position` in data creation script
data_collection_parameters = Column(JSON, nullable=True)
# Foreign keys and relationships
puck_id = Column(Integer, ForeignKey('pucks.id'))