
    $j                         d Z ddlZddlZddlZddlmZ ej                  j                  ej                  j                  e	      d      Z
d Zd Zy)u#   冰箱食材管理 — 数据库层    N)datez	fridge.dbc                  4    t        j                  t              S )N)sqlite_utilsDatabaseDB_PATH     ;/home/mi/.openclaw/workspace/fridge-app/backend/database.pyget_dbr   	   s      ))r	   c                     t               } d| j                         vr+| d   j                  t        t        t        t        dd       d| j                         vrF| d   j                  t        t        t        t        t        dd       | d   j	                  ddd       d	| j                         vrx| d	   j                  t
        t        t        t        t        t        t        t        t        t        t        t        t        t        t        d
d       | d	   j	                  ddd       d| j                         vrS| d   j                  t
        t        t        t        t        t        t        t        t        t
        t
        t        dd       d| j                         vrH| d   j                  t
        t        t        t        t        dd       | d   j                  ddgd       d| j                         vrU| d   j                  t
        t        t        t        t        t        t        t        dd       | d   j	                  ddd       d| j                         vr&| d   j                  t
        t        t        dd       d| j                         vrP| d   j                  t
        t        t        t        t        t        t        dd       | d   j	                  ddd       | S )Nfamilies)idnameinvite_code
created_atr   )pkusers)openid	family_idnickname
avatar_urlr   r   r   foods)r   r   r   categoryquantityunitpurchase_dateexpiry_dateadded_bybarcodenotespricestoragestatusr   recipes)r   r   descriptionrecipe_emojiingredientsingredient_amountspantry_itemssteps
step_timescooking_time
difficultytagsfood_conflicts)r   food_afood_bseverityr%   r0   r1   T)uniqueshopping_list)r   r   r   r   r   r   	purchasedr   tips)r   contentr   orders)r   r   recipe_namerequested_bynote	fulfilledr   )	r   table_namescreatestradd_foreign_keyintfloatcreate_indexbool)dbs    r
   init_dbrF      s   	B ))
:	

  	 	 bnn&&
7
  	 	 	7##KTB bnn&&
7 
  ! 	 	" 	7##KTB ((
9"%
  	 	  r~~//
##%
  	$ 	 	))8X*>t)L bnn..
?""	$
  	# 		 	?++KTJ R^^%%
6

 	 	 	 r~~''
8
  	 	 	8$$[*dCIr	   )__doc__r   osjsondatetimer   pathjoindirname__file__r   r   rF   r   r	   r
   <module>rO      s@    )  	  
'',,rwwx0+
>*kr	   