Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- View
- Navigation
- Algorithm
- 코틀린
- 백준
- room
- BOJ
- ViewModel
- notification
- HTTP
- CoordinatorLayout
- Behavior
- 안드로이드
- activity
- hilt
- AppBarLayout
- Coroutine
- CustomView
- 알고리즘
- 알림
- onLayout
- kotlin
- CollapsingToolbarLayout
- DataBinding
- recyclerview
- onMeasure
- Android
- sqlite
- lifecycle
- LiveData
Archives
- Today
- Total
목록FOREIGN KEY (1)
개발일지
삽질 - SQLite Add Foreign Key
SQLite는 간단하고 가볍지만 기능이 제한적이다. 그 예로 ALTER TABLE로 가능한 기능이 RENAME TABLE, RENAME COLUMN, ADD NEW COLUMN밖에 없고 Foreign Key를 추가할 수 없다. => Foreign Key를 추가하는 방법은 새로운 Table을 만들어서 지정하는 법이 있다. Example (Room Migration) private val MIGRATION_1_2 = object : Migration(1, 2) { override fun migrate(database: SupportSQLiteDatabase) { database.execSQL("CREATE TABLE Drawer(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NUL..
삽질
2021. 1. 18. 23:00