Skip to content

Commit

Permalink
0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pozi119 committed Dec 22, 2022
1 parent d3be3b0 commit 5dfecbc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
[![License](https://img.shields.io/cocoapods/l/SQLiteORM.svg?style=flat)](https://cocoapods.org/pods/SQLiteORM)
[![Platform](https://img.shields.io/cocoapods/p/SQLiteORM.svg?style=flat)](https://cocoapods.org/pods/SQLiteORM)

## 改动(0.1.9)
1. AnyCoder版本改为0.1.5
3. 修复Debug模式下打印SQL语句可能导致Crash的问题
## 改动(0.2.0)
1. 修复重建表结构,从旧表复制数据到新表时,数据丢失的问题。

## 功能
* [x] 根据Class/Struct生成数据表
Expand Down
2 changes: 1 addition & 1 deletion SQLiteORM.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SQLiteORM'
s.version = '0.1.9'
s.version = '0.2.0'
s.summary = 'The swift version of VVSequelize.'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion SQLiteORM/Core/Database.swift
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public final class Database {
public func migrating(_ columns: [String], from fromTable: String, to toTable: String, drop: Bool = false) throws {
guard columns.count > 0 else { return }
let fields = columns.joined(separator: ",")
let sql = "INSERT INTO \(toTable.quoted) (\(fields)) SELECT \(fields) FROM \(toTable.quoted)"
let sql = "INSERT OR IGNORE INTO \(toTable.quoted) (\(fields)) SELECT \(fields) FROM \(fromTable.quoted)"
try run(sql)
if drop {
let dropSQL = "DROP TABLE IF EXISTS \(fromTable.quoted)"
Expand Down

0 comments on commit 5dfecbc

Please sign in to comment.