mirror of
				https://github.com/TeamPiped/Piped-Backend.git
				synced 2024-08-14 23:51:41 +00:00 
			
		
		
		
	Fix datatypes and drop unused duplicate index.
This commit is contained in:
		
							parent
							
								
									d81bb969c7
								
							
						
					
					
						commit
						8f6a954cca
					
				
					 2 changed files with 11 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -8,9 +8,10 @@ import java.util.Set;
 | 
			
		|||
import java.util.UUID;
 | 
			
		||||
 | 
			
		||||
@Entity
 | 
			
		||||
@Table(name = "users", indexes = {@Index(columnList = "id", name = "users_id_idx"),
 | 
			
		||||
@Table(name = "users", indexes = {
 | 
			
		||||
        @Index(columnList = "username", name = "username_idx"),
 | 
			
		||||
        @Index(columnList = "session_id", name = "users_session_id_idx")})
 | 
			
		||||
        @Index(columnList = "session_id", name = "users_session_id_idx")
 | 
			
		||||
})
 | 
			
		||||
public class User implements Serializable {
 | 
			
		||||
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,11 +1,13 @@
 | 
			
		|||
CREATE TABLE IF NOT EXISTS users (
 | 
			
		||||
    id SERIAL NOT NULL,
 | 
			
		||||
    password STRING NULL,
 | 
			
		||||
    session_id STRING(36) NULL,
 | 
			
		||||
    username STRING(24) NULL UNIQUE,
 | 
			
		||||
    CONSTRAINT users_pkey PRIMARY KEY (id ASC),
 | 
			
		||||
    INDEX users_id_idx (id ASC),
 | 
			
		||||
    INDEX username_idx (username ASC)
 | 
			
		||||
    password TEXT NULL,
 | 
			
		||||
    session_id VARCHAR(36) NULL,
 | 
			
		||||
    username VARCHAR(24) NULL UNIQUE,
 | 
			
		||||
    CONSTRAINT users_pkey PRIMARY KEY (id)
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
DROP INDEX IF EXISTS users_id_idx;
 | 
			
		||||
 | 
			
		||||
CREATE INDEX IF NOT EXISTS username_idx ON users (username ASC);
 | 
			
		||||
 | 
			
		||||
--rollback DROP TABLE IF EXISTS users;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue