建立迁移

使用包管理控制台

Add-Migration 迁移名称

(比如 Add-Migration DatabaseInformation_Extension)

在Program处,服务启动之前添加调用函数

private static void CreateDbIfNotExists(IHost host)
{using var scope = host.Services.CreateScope();var services = scope.ServiceProvider;using var context = scope.ServiceProvider.GetRequiredService<BeeNetContext>();context.Database.Migrate();
}

服务器启动时候会自动完成迁移。

SQLite - SQLite 局限性 - 《微软 EntityFrameworkCore 中文文档》 - 书栈网 · BookStack
https://www.bookstack.cn/read/Microsoft.EntityFrameworkCore.Docs.zh-Hans/7%E3%80%81%E6%95%B0%E6%8D%AE%E5%BA%93%E6%8F%90%E4%BE%9B%E7%A8%8B%E5%BA%8F-C%E3%80%81SQLite-B%E3%80%81SQLite%E5%B1%80%E9%99%90%E6%80%A7.md

关于SQLite不支持迁移的问题可以查看一下:

// UNDONE: Not supported by SQLite
//migrationBuilder.AlterColumn<string>(
//    name: "Title",
//    table: "Posts",
//    nullable: false,
//    oldClrType: typeof(string),
//    oldType: "TEXT",
//    oldNullable: true);// Create a new table with the desired schema
// TODO: Randomize the name to avoid conflicts
migrationBuilder.CreateTable(name: "new_Posts",columns: table => new{Id = table.Column<int>(nullable: false).Annotation("Sqlite:Autoincrement", true),Title = table.Column<string>(nullable: false)},constraints: table =>{table.PrimaryKey("PK_Posts", x => x.Id);});// Copy data from the old table. Use NULLIF to specify a default value for newly
// required columns
migrationBuilder.Sql(@"INSERT INTO new_Posts (Id, Title)SELECT Id, IFNULL(Title, '')FROM Posts;
");// Suspend foreign key enforcement during the swap
// TODO: Can't do this on SQL Server. Would need to rebuild referencing foreign
// keys there. But do we even need table rebuilds on SQL Server? Changing
// IDENTITY only requires a column rebuild
// NB: This commits the current transaction. We can't rollback the migration if
// anything after this fails. Maybe we can turn this off before the migration
// and somehow use PRAGMA foreign_key_check. Otherwise, we can mitigate it by
// doing rebuilds as late as possible
migrationBuilder.Sql("PRAGMA foreign_keys = 0;", suppressTransaction: true);// Swap in the new table
migrationBuilder.DropTable(name: "Posts");
migrationBuilder.RenameTable(name: "new_Posts",newName: "Posts");// TODO: We shouldn't do this if foreign key enforcement was off to begin with.
// There's no way to handle this in SQL, so we probably need a way to configure
// this. Maybe we can do this as a post migration step--the migration wouldn't
// fail, but you'd at least get an error if you compromised referential
// integrity
migrationBuilder.Sql("PRAGMA foreign_keys = 1;", suppressTransaction: true);// Rebuild any indexes
migrationBuilder.CreateIndex(name: "IX_Posts_Title",table: "Posts",column: "Title");

NAT穿透问题

  • 获取当前NAT类型:

    ICE协议下NAT穿越的实现(STUN&TURN) - 简书 https://www.jianshu.com/p/84e8c78ca61d

  • 对称NAT穿透的一种新方法 | xd_xd’s blog

    http://xdxd.love/2016/10/18/%E5%AF%B9%E7%A7%B0NAT%E7%A9%BF%E9%80%8F%E7%9A%84%E4%B8%80%E7%A7%8D%E6%96%B0%E6%96%B9%E6%B3%95/

vue初始化项目一直停在downloading template

网络上说用GIT Bash。我使用Git CMD也是可以解决这个问题。

使用electron-vue出现问题:

Html Webpack Plugin:

ReferenceError: process is not defined

Experiencing the same issue on Node 12.2.0. Not sure what causes it, and not entirely convinced the issue is in this repo. Probably a dependency. Removing parts from the template will work for npm run dev, but not so much for npm run build or npm run pack.
My temporary solution was to do modify HtmlWebpackPlugin in .electron-vue/webpack.web.config.js and .electron-vue/webpack.renderer.config.js:

new HtmlWebpackPlugin({filename: 'index.html',template: path.resolve(__dirname, '../src/index.ejs'),templateParameters(compilation, assets, options) {return {compilation: compilation,webpack: compilation.getStats().toJson(),webpackConfig: compilation.options,htmlWebpackPlugin: {files: assets,options: options},process,};},minify: {collapseWhitespace: true,removeAttributeQuotes: true,removeComments: true},nodeModules: false}),

解决方案来源:https://github.com/SimulatedGREG/electron-vue/issues/871

Electron卡在building fresh packages过程

我这里使用的为yarn工具

在.yarnrc(位置为C:\Users\{当前用户名})

添加一下内容

ELECTRON_MIRROR "https://npm.taobao.org/mirrors/electron/"registry "https://registry.npm.taobao.org"sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
phantomjs_cdnurl "http://cnpmjs.org/downloads"
electron_mirror "https://npm.taobao.org/mirrors/electron/"
sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"

结果82s就完成了。

webstorm格式化代码与eslint不一致

规则冲突,遵循ESLint设置

webstorm 设置页面->Editor->Code Style
里面的JavaScript右上有一个set from ,
设置成想要的风格
然后HTML里面Other选项卡里面有个Do not indent children of ,加一个script,然后保存格式化。

蜂巢3.0(原 素材管理器)开发笔记相关推荐

  1. 【Unity植物大战僵尸】音效管理器开发(二十四)

    42.音效管理器开发 导入资源 整理一下GameManager.cs,因为这个脚本要在两个场景中都共用,所以需要把CurrLV相关的移植到LVManager.cs中去,这里就不显示了,说下如何共用,首 ...

  2. Qt+MPlayer音乐播放器开发笔记(二):交叉编译MPlayer以及部署到开发板播放演示

    若该文为原创文章,转载请注明原文出处 本文章博客地址:https://hpzwl.blog.csdn.net/article/details/119991329 长期持续带来更多项目与技术分享,咨询请 ...

  3. Android 编程之入门开发文件夹管理器开发详细讲解-1

    在我们的手持设备中,一般都会自带设备公司自己开发的文件管理系统.拍照系统之类的东东,今天我给大伙说说入门级开发的文件夹管理器,代码贼少 总共就6个类吧,没有夹杂其他外部应用,就是一个纯文件夹管理器 A ...

  4. 【Unity植物大战僵尸】关卡管理器开发(中)(二十)

    目录 37.关卡管理器中僵尸刷新完善 测试 38.关卡管理器天数和波数开发 37.关卡管理器中僵尸刷新完善 导入资源 然后创建2d图像,将第一个LVStartUIEF(1).png放进去,然后加入动画 ...

  5. 【原】[webkit移动开发笔记]之空链接是使用javascript:void(0)还是使用#none

    基于webkit内核的移动开发笔记,之前已经写过4篇,主要是关于移动开发重构的分享,今晚有空了再写一篇. 回忆去年年底最后的一个项目,还有一个很怪异的bug,让项目团队的成员感到十分头疼.测试组的同事 ...

  6. win7 IIS7.0 【IIS 管理器无法验证此内置帐户是否有访问权】

    异常信息: 服务器配置为将传递身份验证和内置帐户一起使用,以访问指定的物理路径.但是,IIS 管理器无法验证此内置帐户是否有访问权.请确保应用程序池标识具有该物理路径的读取访问权.如果此服务器加入到域 ...

  7. 基于 OpenFire 的TVBox管理平台开发笔记

    目录 一.開發環境設置.... 3 1.1 JDK 安裝.... 3 1.2 MySql Server安裝.... 4 1.3 OpenFire安裝.... 6 1.4 Openfire Admin ...

  8. Make工程管理器(读书笔记)

    到此为止,读者已经了解了如何在Linux下使用编辑器编写代码,如何使用Gcc把代码编译成可执行文件,还学习了如何使用Gdb来调试程序,那么,所有的工作看似已经完成了,为什么还需要Make这个工程管理器 ...

  9. 简单的图片管理器开发

    在游戏开发中,图片管理工具是必不可少的.它的主要功能是 1:将图片转化为自已的数据格式. 2:管理和组织图片文件.编辑图片. 3:打包,压缩等. 还可以在图片工具中加入图片序列转为动画片.或者其它的复 ...

最新文章

  1. 怎么能把看不清的照片给看清_哪些人会得?应该怎么治?关于白内障的“经典十问”...
  2. Debian GNU Linux 4.0 r4
  3. 1247 排排站 USACO(查分+hash)
  4. CLR via C# 读书笔记 3-6 比较APM和EAP(异步编程模型和基于事件的编程模式)
  5. mysql之 xtrabackup原理、备份日志分析、备份信息获取
  6. 实时查询(otoci)
  7. Creator开源游戏、插件、教程、视频汇总
  8. 常用的英文文献引用格式
  9. SSM汽车租赁管理系统毕业设计源码052158
  10. 童年经典,任天堂switch红白机游戏
  11. tplink作为无线交换机使用
  12. 运维工程师模拟面试题
  13. python与医学统计_医学统计思维-数据库
  14. 计算机视觉—期刊|会议名称以及出版社对应大全
  15. Node.js使用ffi-napi,ref-array-napi,ref-struct-napi调用动态库
  16. JavaScript 技术知识
  17. jvm 之 国际酒店 6月25日上线内存溢出原因
  18. 早产儿发育迟缓怎么办
  19. 刘擎《西方现代思想讲义》思维导图xmind及笔记
  20. 提取惠普ZBook 15 G2笔记本电脑内建显示器的EDID并修改注入Clover完美驱动内屏实现内外双屏显示

热门文章

  1. 启动redis失败 Could not create server TCP listening socket 127.0.0.1:6379: bind: 操作成功
  2. 2019.03.26 bzoj4444: [Scoi2015]国旗计划(线段树+倍增)
  3. 安装使用完虚拟机UltraISO后,删除电脑中多出的“CD驱动器”盘符
  4. 记录Robotium黑盒测试一个APK文件学习之从签名到简单测试
  5. 简单的猜数字游戏--入门
  6. mk16i android 8,索爱MK16i评测:机身做工优良
  7. 配置华为防火墙安全策略
  8. 苹果公布 2022 Apple 设计大奖入围作品
  9. word里文字竖向排列(设置竖排文字)
  10. mysql expire_mysql expire_logs_days是怎么生效的