Fix wrong table in macro update
This commit is contained in:
		
							parent
							
								
									98db89ce03
								
							
						
					
					
						commit
						cacd740bd9
					
				
					 5 changed files with 440 additions and 684 deletions
				
			
		
							
								
								
									
										12
									
								
								.sqlx/query-2b34934e10005378c331f489751dcc4dc5cc79a52299cb74018e36212809288a.json
									
										
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								.sqlx/query-2b34934e10005378c331f489751dcc4dc5cc79a52299cb74018e36212809288a.json
									
										
									
										generated
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
{
 | 
			
		||||
  "db_name": "SQLite",
 | 
			
		||||
  "query": "UPDATE macros SET name = ? WHERE id = ?",
 | 
			
		||||
  "describe": {
 | 
			
		||||
    "columns": [],
 | 
			
		||||
    "parameters": {
 | 
			
		||||
      "Right": 2
 | 
			
		||||
    },
 | 
			
		||||
    "nullable": []
 | 
			
		||||
  },
 | 
			
		||||
  "hash": "2b34934e10005378c331f489751dcc4dc5cc79a52299cb74018e36212809288a"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1106
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										1106
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -23,7 +23,7 @@ chrono = { version = "0.4", features = ["serde"] }
 | 
			
		|||
 | 
			
		||||
sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio", "macros", "chrono"] }
 | 
			
		||||
libsqlite3-sys = { version = "*", features = ["bundled"] }
 | 
			
		||||
uuid = "1.6"
 | 
			
		||||
uuid = { version = "1.8", features = ["v4"] }
 | 
			
		||||
futures = "0.3"
 | 
			
		||||
libc = "0.2"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
export DATABASE_URL=sqlite://${PWD}/emgauwa-dev.sqlite
 | 
			
		||||
 | 
			
		||||
sqlx:
 | 
			
		||||
	cargo sqlx database drop -y
 | 
			
		||||
	cargo sqlx database create
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -97,7 +97,7 @@ impl DbMacro {
 | 
			
		|||
		conn: &mut PoolConnection<Sqlite>,
 | 
			
		||||
		new_name: &str,
 | 
			
		||||
	) -> Result<DbMacro, DatabaseError> {
 | 
			
		||||
		sqlx::query!("UPDATE relays SET name = ? WHERE id = ?", new_name, self.id,)
 | 
			
		||||
		sqlx::query!("UPDATE macros SET name = ? WHERE id = ?", new_name, self.id,)
 | 
			
		||||
			.execute(conn.deref_mut())
 | 
			
		||||
			.await?;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue