数据库篇之[bsp_banners]数据表-网上商城BrnShop1.9升级至2.1升级说明(非官方版本)

简介:

asp.net(c#)网上商城BrnShop1.9升级至2.1升级说明(非官方版本)
主要描述在数据库方面进行升级(使用前请参照网上商城BrnShop1.9升级至2.1升级说明(非官方版本仅提供技术交流)的使用协议)

BrnShop1.9正式版本

/****** Object:  Table [dbo].[bsp_banners]    Script Date: 12/09/2014 14:07:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [bsp_banners](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[starttime] [datetime] NOT NULL,
	[endtime] [datetime] NOT NULL,
	[isshow] [tinyint] NOT NULL,
	[title] [nvarchar](100) NOT NULL,
	[img] [nvarchar](250) NOT NULL,
	[url] [nvarchar](250) NOT NULL,
	[displayorder] [int] NOT NULL,
 CONSTRAINT [PK_bsp_banners] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [starttime_endtime_isshow] ON [bsp_banners] 
(
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'bannerid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'starttime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'endtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否展示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'isshow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'img'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'displayorder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'banner表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners'
GO
SET IDENTITY_INSERT [bsp_banners] ON
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (1, CAST(0x0000A35100B595F0 AS DateTime), CAST(0x0000A4D700B595F0 AS DateTime), 1, N'火爆促销', N'fr_1412061404492825858.jpg', N'/', 5)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (4, CAST(0x0000A385017AA854 AS DateTime), CAST(0x0000A4D6017AA854 AS DateTime), 1, N'火爆促销', N'fr_1412061404419541666.jpg', N'/', 6)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (5, CAST(0x0000A3EB0148AB74 AS DateTime), CAST(0x0000A5580148AB74 AS DateTime), 1, N'火爆促销', N'fr_1412061405306289506.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (6, CAST(0x0000A3EB0148CD70 AS DateTime), CAST(0x0000A5540148CD70 AS DateTime), 1, N'火爆促销', N'fr_1412061404554409380.jpg', N'/', 0)
SET IDENTITY_INSERT [bsp_banners] OFF


BrnShop2.1正式版本

/****** Object:  Table [dbo].[bsp_banners]    Script Date: 01/13/2015 10:11:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [bsp_banners](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[type] [tinyint] NOT NULL,
	[starttime] [datetime] NOT NULL,
	[endtime] [datetime] NOT NULL,
	[isshow] [tinyint] NOT NULL,
	[title] [nvarchar](100) NOT NULL,
	[img] [nvarchar](250) NOT NULL,
	[url] [nvarchar](250) NOT NULL,
	[displayorder] [int] NOT NULL,
 CONSTRAINT [PK_bsp_banners] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [type_starttime_endtime_isshow] ON [bsp_banners] 
(
	[type] ASC,
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'bannerid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型(0代表PC,1代表手机)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'starttime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'endtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否展示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'isshow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'img'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'displayorder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'banner表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners'
GO
SET IDENTITY_INSERT [bsp_banners] ON
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (1, 0, CAST(0x0000A35100B595F0 AS DateTime), CAST(0x0000A4D700B595F0 AS DateTime), 1, N'火爆促销', N'fr_1412061404492825858.jpg', N'/', 5)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (4, 0, CAST(0x0000A385017AA854 AS DateTime), CAST(0x0000A4D6017AA854 AS DateTime), 1, N'火爆促销', N'fr_1412061404419541666.jpg', N'/', 6)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (5, 0, CAST(0x0000A3EB0148AB74 AS DateTime), CAST(0x0000A5580148AB74 AS DateTime), 1, N'火爆促销', N'fr_1412061405306289506.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (6, 0, CAST(0x0000A3EB0148CD70 AS DateTime), CAST(0x0000A5540148CD70 AS DateTime), 1, N'火爆促销', N'fr_1412061404554409380.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (7, 1, CAST(0x0000A40700AEA434 AS DateTime), CAST(0x0000A6E400AEA434 AS DateTime), 1, N'特大促销', N'fr_1412201036420464063.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (8, 1, CAST(0x0000A40700AEEF34 AS DateTime), CAST(0x0000A6DD00AEEF34 AS DateTime), 1, N'特大促销', N'fr_1412201037096779867.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (9, 1, CAST(0x0000A40700AF0B54 AS DateTime), CAST(0x0000A6E400AF0B54 AS DateTime), 1, N'特大促销', N'fr_1412201037338523694.jpg', N'/', 0)
SET IDENTITY_INSERT [bsp_banners] OFF

其中差异内容如图

差异内容有:

1.有[type]列

2.非聚合索引名称

3.执行增加扩展属性

4.数据插入

更新方法:

ALTER TABLE [bsp_banners]
  ADD [type] [tinyint]
  GO
  UPDATE [bsp_banners]
  SET [type] = 0	-- 默认为PC端
  GO
  ALTER TABLE [bsp_banners]
  ALTER COLUMN [type] [tinyint] NOT NULL	-- 
  GO
  CREATE NONCLUSTERED INDEX [type_starttime_endtime_isshow] ON [bsp_banners] 
(
	[type] ASC,
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型(0代表PC,1代表手机)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'type'


目录
相关文章
|
16天前
|
缓存 数据库 数据安全/隐私保护
Discuz! X 数据库字典详解:DZ各数据表作用及字段含义
我们使用DISCUZ做网站时,有时需要对数据表进行操作,在操作数据表之前,需要对数据表进行了解。下面是DISCUZ 数据库各数据表作用及字段含义详解,方便新手更好的了解DISCUZ数据库。
42 4
|
1月前
|
SQL JSON 关系型数据库
MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
【10月更文挑战第3天】MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
116 5
|
12天前
|
SQL 关系型数据库 数据库连接
"Nacos 2.1.0版本数据库配置写入难题破解攻略:一步步教你排查连接、权限和配置问题,重启服务轻松解决!"
【10月更文挑战第23天】在使用Nacos 2.1.0版本时,可能会遇到无法将配置信息写入数据库的问题。本文将引导你逐步解决这一问题,包括检查数据库连接、用户权限、Nacos配置文件,并提供示例代码和详细步骤。通过这些方法,你可以有效解决配置写入失败的问题。
36 0
|
16天前
|
XML 缓存 数据库
Discuz! X3.0 版本的数据库字典
Discuz! X3.0 版本的数据库字典
35 0
|
18天前
|
JavaScript 前端开发 测试技术
[新手入门]todolist增删改查:vue3+ts版本!
【10月更文挑战第15天】[新手入门]todolist增删改查:vue3+ts版本!
|
19天前
|
监控 关系型数据库 MySQL
如何升级MySQL数据库?
【10月更文挑战第16天】如何升级MySQL数据库?
|
2天前
|
SQL 关系型数据库 MySQL
go语言数据库中mysql驱动安装
【11月更文挑战第2天】
13 4
|
25天前
|
存储 关系型数据库 MySQL
Mysql(4)—数据库索引
数据库索引是用于提高数据检索效率的数据结构,类似于书籍中的索引。它允许用户快速找到数据,而无需扫描整个表。MySQL中的索引可以显著提升查询速度,使数据库操作更加高效。索引的发展经历了从无索引、简单索引到B-树、哈希索引、位图索引、全文索引等多个阶段。
58 3
Mysql(4)—数据库索引
|
11天前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。
本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。同时,文章还对比了编译源码安装与使用 RPM 包安装的优缺点,帮助读者根据需求选择最合适的方法。通过具体案例,展示了编译源码安装的灵活性和定制性。
49 2
|
14天前
|
存储 关系型数据库 MySQL
MySQL vs. PostgreSQL:选择适合你的开源数据库
在众多开源数据库中,MySQL和PostgreSQL无疑是最受欢迎的两个。它们都有着强大的功能、广泛的社区支持和丰富的生态系统。然而,它们在设计理念、性能特点、功能特性等方面存在着显著的差异。本文将从这三个方面对MySQL和PostgreSQL进行比较,以帮助您选择更适合您需求的开源数据库。
57 4
下一篇
无影云桌面