외래키 설정(참조하기)
2021. 7. 6. 14:07
DB/Prisma, SQL, MongoDB
ALTER TABLE `robot` ADD FOREIGN KEY (`city`) REFERENCES `area` (`city`); 왼쪽것이 오른쪽을 참조하는 것이다 따라서 오른쪽이 생성되고 자연스럽게 왼쪽값이 오른쪽을 참조하는 것이다

에러) Cannot Add Foreign Key Constraint
2021. 7. 6. 14:06
에러
이것을 쓸때 Cannot Add Foreign Key Constraint 에러가 생기면? ALTER TABLE `alsum` ADD FOREIGN KEY (`city`) REFERENCES `area` (`city`); 참조하는 값을 primary key로 설정해주고 (참조 받는 것은 상관없다) 다른 primary key가 없도록 해준다. id가 primary 하고 있다면 id 컬럼 없애주기
React Native) 로딩화면 페인드인 구현
2021. 7. 5. 23:12
Frontend/React & React.Native &Next.js
앞에 로딩화면 구현한 것에 로딩페이지에서 이 코드를 더해야 한다 import React from "react"; import { StyleSheet, Text, View, Image, Animated } from "react-native"; export default class LoadingScreen extends React.Component { state = { animation: new Animated.Value(1), }; componentDidMount() { setTimeout(() => { this.setState( Animated.timing(this.state.animation, { toValue: 0, duration: 2000, }).start() ); }, 1000); } rende..
React Native) splash screen(로딩화면)
2021. 7. 5. 23:10
Frontend/React & React.Native &Next.js
export default class App extends React.Component { state = { isLoading: true, }; componentDidMount = async () => { setTimeout(() => { this.setState({ isLoading: false }); }, 3000); }; render() { if (this.state.isLoading) { return ; } else { return (