+
    Ki  c                   s4   ^ RI Ht ^ RIHt ^ RIHt RRRRRR	R
/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RRRR/RR RR/RR!RR/RR"RR/.R#RRRRR	R
/RR RR/RR$RR/RRRR/RRRR/RR%RR/RR&RR/RR'RR/RR(RR/RR)RR/.
R*RRRRR	R
/RR+RR,/.R-RRRRR	R
/RRRRR.R
/.R/RR0RRR	R1/RR2RRR	R1/.R3RRRRR	R
/RRRRR.R
/RR4RRR.R1/./tR5 tR;R6 ltR7 t	R8 t
R9 tR:# )<i    )settings)sql)loggerZgamesnameZidtypeZINTEGERindexedTZTEXTZsortnameZslugZinstaller_slugZparent_slugZplatformZrunnerZ
executableZ	directoryZupdatedZDATETIMEZ
lastplayedZ	installedZinstalled_atZyearZ
configpathZhas_custom_bannerZhas_custom_iconZhas_custom_coverart_bigZplaytimeZREALZserviceZ
service_idZ
discord_idZservice_gamesZappidZiconZlogoZurlZdetailsZlutris_slugZsourcesZurizTEXT UNIQUEZ
categoriesuniqueZgames_categoriesZgame_idFZcategory_idZsaved_searchesZsearchc                sz   . pRV ,          p\         P                  ! \        P                  4      ;_uu_ 4       pVP	                  V4      P                  4        FC  pRV^,          RV^,          RV^,          RV^,          RV^,          /pVP                  V4       KE  	  RRR4       V#   + '       g   i     T# ; i)zY
Fields:
    - position
    - name
    - type
    - not null
    - default
    - indexed
zpragma table_info('%s')r   r   Znot_nullZdefaultr   N)r   	db_cursorr    DB_PATHexecuteZfetchallappend)Z	tablenameZtablesquerycursorZrowfields   &     ;/usr/lib/python3.14/site-packages/lutris/database/schema.py
get_schemar   E   s     F%	1E	x''	(	(F>>%(113CAACF3q63q6E MM%  4 
) M 
)	( Ms   A'B))B:	c                s\    V : RV: 2pV'       d
   VR,          pV'       d
   VR,          pV# )z>Converts a python based table definition to it's SQL statementZ z PRIMARY KEYz UNIQUE )r   r   r   r   Zfield_querys   &&&& r   field_to_stringr   ^   s,    !4(K~%y     c           
     s\   RP                  V Uu. uF  p\        R/ VB NK  	  up4      pRV : RV: R2p\        P                  ! RV4       \        P
                  ! \        P                  4      ;_uu_ 4       pVP                  V4       RRR4       R# u upi   + '       g   i     R# ; i)z#Creates a new table in the databasez, zCREATE TABLE IF NOT EXISTS z (Z)z
[Query] %sNr   )	Zjoinr   r   Zdebugr   r   r    r   r	   )r   schemaZfZfieldsr   r   s   &&    r   create_tabler   h   s{    YYf=f,!,f=>F48&AE
LLu%	x''	(	(Fu 
)	( > 
)	(	(s   B9BB+	c                sj   \        V 4      p. pV'       d   V Uu. uF  qDR,          NK  	  ppV Fn  pVR,          V9  g   K  \        P                  ! RWR,          4       VP                  VR,          4       \        P
                  ! \        P                  W4       Kp  	  V# \        W4       V# u upi )aN  Compare a database table with the reference model and make necessary changes

This is very basic and only the needed features have been implemented (adding columns)

Args:
    table (str): Name of the table to migrate
    schema (dict): Reference schema for the table

Returns:
    list: The list of column names that have been added
r   zMigrating %s field %s)	r   r   Zinfor
   r   Z	add_fieldr    r   r   )Ztabler   Zexisting_schemaZmigrated_fieldsZcolZcolumnsr   s   &&     r   migrater   q   s     !'OO*9:/3v;;/:EV}G+3U&MJ&&uV}5h..=	   	U# ;s   B0c                 sV    \         P                  4        F  w  r\        W4       K  	  R# )zaUpdate the database to the current version, making necessary changes
for backwards compatibility.N)DATABASEZitemsr   )Z
table_nameZ
table_datas     r   syncdbr      s      #+.."2

' #3r   N) r   FF)Zlutrisr    Zlutris.databaser   Zlutris.util.logr   r   r   r   r   r   r   r   r   r   <module>r      s     " 	vy)T:	(JF	
 
(	!662	/	VV,	66*	vv.	ff-	FJ/	vy1	fi0	3	+	vv.	$fi8	"FI6	*FI>	VV,	FF+	vv.LF	
5> 	vy)T:	FF+	&&)	(	(	(	(	'	FF+	/ 	vy)T:	. 	vy)T:	48 	FIy%@		9eD 	vy)T:	48	668U;q=@26(r   